Dgraph Gateway has a default Log4j configuration file that sets its logging properties.
The file is named EndecaServerLog4j.properties and is located in the $DOMAIN_HOME/config directory.
log4j.rootLogger=WARN, stdout, ODL # Console Appender log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d [%p] [%c] %L - %m%n # ODL-format Log Appender log4j.appender.ODL=com.endeca.util.ODLAppender log4j.appender.ODL.MaxSize=104857600 log4j.appender.ODL.MaxSegmentSize=10485760 log4j.appender.ODL.encoding=UTF-8 # Log level per packages log4j.logger.com.endeca=ERROR log4j.logger.org.apache.zookeeper=WARN
The file defines two appenders (stdout and ODL) for the root logger and also sets log levels for two packages.
Logging property | Description |
---|---|
log4j.rootLogger=WARN, stdout, ODL | The level of the root logger is defined as WARN and attaches the Console Appender (stdout) and ODL-format Log Appender (ODL) to it. |
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | Defines stdout as a Log4j ConsoleAppender |
org.apache.log4j.PatternLayout | Sets the PatternLayout class for the stdout layout. |
log4j.appender.stdout.layout.ConversionPattern | Defines the log entry conversion
pattern as:
For other conversion characters, see: https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html |
log4j.appender.ODL=com.endeca.util.ODLAppender | Defines ODL as an ODL Appender. ODL (Oracle Diagnostics Logging) is the logging format for Oracle applications. |
log4j.appender.ODL.MaxSize | Sets the maximum amount of disk space to be used by the <ServerName>-diagnositic.log file and the logging rollover files. The default is 104857600 (about 100 MB). |
log4j.appender.ODL.MaxSegmentSize | Sets the maximum size (in bytes) of the log file. When the <ServerName>-diagnositic.log file reaches this size, a rollover file is created. The default is 104857600 (about 10 MB). |
log4j.appender.ODL.encoding | Sets character encoding the log file. The default UTF-8 value prints out UTF-8 characters in the file. |
log4j.logger.com.endeca | Sets the default log level for the Endeca logger. ERROR is the default log level. |
log4j.logger.org.apache.zookeeper | Sets the default log level for the ZooKeeper logger. WARN is the default log level. |
For details on the FileHandler settings, see http://docs.oracle.com/javase/7/docs/api/java/util/logging/FileHandler.html
log4j.logger.com.endeca=INFO
In the example, the log level for the Endeca logger is set to INFO.
These levels allow you to monitor events of interest at the appropriate granularity without being overwhelmed by messages that are not relevant. When you are initially setting up your application in a development environment, you might want to use the DEBUG level to get all messages, and change to a less verbose level in production.
Note that restarting the Dgraph Gateway is required after the log properties file has been modified.