On 10/4/2018 12:30 AM, lala wrote:
Hi,
I am using:
Solr: 7.4
OS: windows7
I start solr using a service on startup.
In that case, I really have no idea where anything is on your system.
There is no service installation from the Solr project for Windows --
either you obtained that from somewhere else, or it's something written
in-house. Either way, you would need to talk to whoever created that
service installation for help locating files on your setup.
In general, you need to find the log4j2.xml file that is controlling
your logging configuration and modify it. It contains a sample of how
to log something to a separate file -- the slow query log. That example
redirects a specific logger name (which is similar to a full qualified
class name and in most cases *is* the class name) to a different logfile.
Version 7.4 has a bug when running on Windows that causes a lot of
problems specific to logging.
https://issues.apache.org/jira/browse/SOLR-12538
That problem has been fixed in the 7.5 release. You can also fix it by
editing the solr.cmd script manually.
Additional info: I am developing a web application that uses solr as search
engine, I use DIH to index folders in solr using the
FileListEntityProcessor. What I need is logging each index operation in a
file that I can reach & read to be able to detect failed index files in the
folder.
The FileListEntityProcessor class has absolutely no logging in it. If
you require that immediately, you would need to add logging commands to
the source code and recompile Solr yourself to produce a package with
your change. With an enhancement issue in Jira, we can review what
logging is suitable for the class, and probably make it work like
SQLEntityProcessor in that regard. If that's done the way I think it
should be, then you could add config in log4j2.xml to could enable DEBUG
level logging for that class specifically and write its logs to a
separate logfile.
Thanks,
Shawn