When running fscrawler 7.2.7 as a service (Windows server 2016) should it be possible to see debug or trace logs by adding the --debug or --trace flag?
We are using nssm v2.24 to generate the service.
I successfully added the --debug or --trace flag to a batch file that was called by a Scheduled task (configured to run on system startup after x minutes) but we would like to use a Windows Service.
I'm wondering if you can edit the config/log4j2.xml file and activate a trace level in it instead of using the CLI options... Have a look at:
<Properties>
<!-- If you want to change the log level for fscrawler.log file -->
<Property name="LOG_LEVEL">info</Property>
<!-- If you want to change the log level for documents.log file -->
<Property name="DOC_LEVEL">info</Property>
<!-- If you want to change the output dir for logs -->
<Property name="LOG_DIR">logs</Property>
</Properties>
Thanks to your advice I got the logging to work as I want.
1 line per document and low volumes for fscrawler.log
I specified the log path in LOG_DIR.
<Properties>
<!-- If you want to change the log level for fscrawler.log file -->
<Property name="LOG_LEVEL">info</Property>
<!-- If you want to change the log level for documents.log file -->
<Property name="DOC_LEVEL">debug</Property>
<!-- If you want to change the output dir for logs -->
<Property name="LOG_DIR">c:\Progra~1\fscrawler-es7-2.7\data2\testv003\logs</Property>
</Properties>
Looking back at my batch file fscrawlerRunner_V035.bat
I have 2 set FS_JAVA_OPTS. Does the 2nd overwrite the 1st?
How do I safely combine then or check their value?
set JAVA_HOME=c:\Program Files\elasticsearch-7.10.2\jdk
set FS_JAVA_OPTS=-Xmx2g -Xms2g
set FS_JAVA_OPTS="-Dlog4j.configurationFile=file:C:\Progra~1\fscrawler-es7-2.7\data2\testv003\log4j2_v035.xml"
rem set FS_JAVA_OPTS="-DLOG_DIR=c:\Progra~1\fscrawler-es7-2.7\data2\testv003\logs -DLOG_LEVEL=trace -DDOC_LEVEL=debug"
rem "c:\Progra~1\fscrawler-es7-2.7\bin\fscrawler.bat" testv001 --config_dir C:\Progra~1\fscrawler-es7-2.7\data2\testv003
c:\Progra~1\fscrawler-es7-2.7\bin\fscrawler.bat --config_dir c:\Progra~1\fscrawler-es7-2.7\data2 testv003 >> c:\Progra~1\fscrawler-es7-2.7\logs\fscrawler.log 2>&1
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.