Bick
Bick

Reputation: 18541

solr not writing logs when it runs not from its main folder

When I run solr using

java -jar "C:\solr\example\start.jar"

It writes logs to C:\solr\example\logs.

When I run it using

java -Dsolr.solr.home="C:\solr\example\solr" 
     -Djetty.home="C:\solr\example" 
     -Djetty.logs="C:\solr\example\logs" 
     -jar "C:\solr\example\

start.jar"

it writes logs only if I run it from

C:\solr\example>

any other folder - logs are not written.
This is important as I need to run it as a service later (using nssm) What should I change?

Upvotes: 0

Views: 225

Answers (2)

Allan Macmillan
Allan Macmillan

Reputation: 1491

Both answers should work for you.

You could set it up using apache Tomcat as opposed to the Jetty instance Solr comes with. Tomcat which comes standard with a startup.bat batch file that you use to start your server

Upvotes: 0

CoreTech
CoreTech

Reputation: 2433

As you have discovered, the Jetty-hosted example distributed with Solr must be started in the example directory to function properly. Try creating a batch file that changes to the directory then invokes Java, like this:

C:
cd C:\solr\example\
java -Dsolr.solr.home="C:\solr\example\solr" 
     -Djetty.home="C:\solr\example" 
     -Djetty.logs="C:\solr\example\logs" 
     -jar "C:\solr\example\

Then have NSSM run the batch file instead of java.

Upvotes: 1

Related Questions