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.
The log rotation frequency is set to daily (it is hard-coded, not configurable). This means that a new log file is created either when the log file reaches a certain size (the MaxSegmentSize
setting) or when a particular time is reached (it is 00:00 UTC for Dgraph Gateway).
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.server.logging.ODLAppender log4j.appender.ODL.MaxSize=1048576000 log4j.appender.ODL.MaxSegmentSize=104857600 log4j.appender.ODL.encoding=UTF-8 log4j.appender.ODL.MaxDaysToRetain=7 # Zookeeper client log level log4j.logger.org.apache.zookeeper=WARN
The file defines two appenders (stdout and ODL) for the root logger and also sets log levels for the ZooKeeper client package.
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 1048576000 (about 1GB). Older log files are deleted to keep the total log size under the given limit. |
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.appender.ODL.MaxDaysToRetain |
Sets how long (in days) older log file should be kept. Files that are older than the given days are deleted. Files are deleted only when there is a log rotation. As a result, files may not be deleted for some time after the retention period expires. The value must be a positive integer. The default is 7 days. |
log4j.logger.org.apache.zookeeper |
Sets the default log level for the ZooKeeper client logger (i.e., not for the ZooKeeper server that is running on the Hadoop environment). WARN is the default log level. |