Doradus Configuration and Operation : Setting Doradus Logging Options

Setting Doradus Logging Options
Doradus logs messages about its operation using the log4j logging facility. Logging options are defined in the file log4j-server.properties. The high-level logging options are shown below:
log4j.rootLogger=DEBUG, console, file, memory
log4j.logger.org.eclipse.jetty=INFO
log4j.appender.console.Threshold=INFO
log4j.appender.file.Threshold=INFO
log4j.appender.memory.Threshold=DEBUG
This sets the global logging level to DEBUG and defines multiple “appenders”: console (stdout), a disk file, and memory. Although DEBUG-level log records are generated, only INFO-level entries (and above) are sent to the console and file appenders. DEBUG entries are only collected by the memory appender. This minimizes the output to the console- and file-based logs, but it allows the most recent DEBUG records to be retrieved via the REST command: GET /_logs.
If Doradus is run as a service, the output to console is unnecessary, so this parameter should be removed. Additionally, the lines that begin with log4j.appender.console should be deleted or commented-out.
Because the memory appender only retains the most recent log entries, in diagnostic situations, you might want to capture DEBUG entries in the file log as well. Note that this causes log files to grow more quickly. DEBUG entries can be captured in the file appender by changing the following line:
log4j.appender.console.Threshold=DEBUG
The log4j-server.properties file also defines the following option:
log4j.appender.file.File=doradus.log
This option sends the file log appender to a log file called doradus.log in the Doradus server’s runtime directory. If you wish log files to be stored with another name and/or in another location, modify this option with a new relative or absolute file name.
Two other options to consider:
log4j.appender.file.maxBackupIndex=50
log4j.appender.file.maxFileSize=20MB
These options cause the log file to grow up to 20MB, at which point it is renamed with a numeric extension (.1, .2, etc.) and a new file is started. Up to 50 files are retained (up to 1GB total log data), at which point the oldest file is removed. Modify these options to increase or decrease the number and size of log files stored.