I would like to know where to find Nuxeo log files ? How are those files managed?
First to know where are the logging file, you have to look 2 things:
Nuxeo configuration: /the/location/of/the/nuxeo.conf
this xml file contains all information of how log4j will produce logs.
You have to understand 2 notions:
Configuration specified into a category on a package will be inherited for all children packages. So if you specify that category:
<category name="org.nuxeo.ecm"> <priority value="INFO" /> <appender-ref ref="CONSOLE" /> <appender-ref ref="FILE" /> </category>
all sub-packages (org.nuxeo.ecm.platform, org.nuxeo.ecm.runtime, ...) will produce INFO logs and higher logs (WARN, ERROR and FATAL) into the FILE appender and the CONSOLE appender
There is a special category specified by the root item. His configuration will transmit this configuration to "org", "fr", ... packages.
About the appender configuration, you can look into the log4j documentation, but I can give you some example here:
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender"> <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler" /> <param name="File" value="${nuxeo.log.dir}/server.log" /> <param name="Append" value="true" /> <!-- Rollover at midnight every day --> <param name="DatePattern" value="'.'yyyy-MM-dd" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ISO8601} %-5p [%c] %m%n" /> </layout> </appender>
is an appender that write logs into a file daily rolling (a new file will be regenerated each day). The file is create into the "nuxeo.log.dir" directory (value given by the nuxeo.conf) into the server.log file. The layout item specify how log4j will expose each line of logs. %d represent the date, %c the class responsible of the log.
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler" /> <param name="Target" value="System.out" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n" /> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="levelMin" value="INFO" /> </filter> </appender>
is an appender that writes logs into the console of the server. The levelMin value INFO ask to not display logs lower than INFO (DEBUG and TRACE). We do that a part because on some system console logging are written synchronously. So if you log too much thing, this will slow down the server.
There is many many possibilities of appender (SMTP, SNMTP, SMS ...) and configuration possibilities. I let you discover that...
The error information will go to the server.log, which is a global catch-it-all log in default configutration, as well as nuxeo-error.log, used just for error output. This behavior can be modified in your log4j.xml file in the lib directory of the server.
<$NUXEO_HOME>/lib/log4j.xml
The output that you see depends on the logging level in the appender. If you want to see the debug output, you need to modify the log4j.xml root entry to say the following (in this case FILE refers to server.log.
Approving this answer, just leaving this note in this comment, so that the root logger is not forgotten, as it manages how all appenders receive their logging information.
I don't want to modify the files in lib/ (why would anyone put a configuration file in a "lib" directory??). Can the file location be changed via an environment variable, configuration directive or command line?
This is Tomcat-specific, we didn't invent this location. I'll refer you to the Tomcat documentation for that.