Agent log configuration
The following explains how to manage log data generated in the Java application environment through the agent. It includes the configuration of the path and name of the log file, retention period setting, log monitoring, and how to enable custom log tracing. It also provides various options for log management to help manage system logs efficiently.
Setting the path and name
The path and name of the agent log can be set in whatap.conf. The default value of log_root is the ${WHATAP_HOME}/logs path.
log_root=whatap/logs
log_name=whatap
Log management options
By writing the log-related options in whatap.conf, you can manage the log content.
watchlog_enabled=true
log_rotation_enabled=true
log_oname_enabled=true
log_keep_days=7
-
watchlog_enabled Boolean
Default
falseIf the value is
true, the log monitoring is enabled. -
watchlog_check_interval Int
Default
2000It is the interval for monitoring the logs. At every interval, it checks whether any record has been added to the log file.
-
watchlog_read_count Int
Default
8It is the maximum count to read logs. It reads as many as
watchlog_buffer_sizeat a time. -
watchlog_buffer_size Int
Default
131072(128k)Size for reading logs at a time.
-
watchlog.LOGKEY
This is the setting to monitor a log file. Enter the
filename and set multiplewordswith the delimiter, comma (,). It watches the logs atcheck_intervaland alerts you when any keywords are found. Once an alert has occurred, the occurrence of alert stops for thesilentperiod.- watchlog.LOGKEY.enabled Boolean Default
true - watchlog.LOGKEY.file String
- watchlog.LOGKEY.words String
- watchlog.LOGKEY.silent Int Default
10000 - watchlog.LOGKEY.check_interval Int Default
1000
- watchlog.LOGKEY.enabled Boolean Default
-
log_root String
Default
${WHATAP_HOME}/logsSet the agent's log path.
-
log_datasource_lookup_enabled Boolean
Default
trueThe function to record the log is activated in case of DataSource upon InitialContext Lookup.
-
log_rotation_enabled Boolean
Default
trueThe function to store agent log files by date is activated. The log file name is stored in the format of whatap-'yyyymmdd'.log. If the value is
false, the log file name is stored in the format of whatap.log. -
log_keep_days Int
Default
7It sets the log file retention period. It works only when the
log_rotation_enabledvalue istrue. -
log_oname_enabled Boolean
Default
falseIf the value is
true, add agent names for each log.
LogSink
In whatap.agent-2.1.0 or later, the LogSink function is provided for integrated monitoring of the application server.
The LogSink option is available in whatap.agent-2.1.0 or later.
Enabling the log monitoring function
-
logsink_enabled Boolean
Default
falseIt enables the log monitoring function.
-
logsink_trace_enabled Boolean
Default
falseSet whether or not to expose the log tab of the transaction trace by inserting the transaction ID into the logs.
Collecting framework logs
To monitor logs collected from the framework, add the setting and plugin to intercept logs from the module. Set the default category name for logs collected in the framework to AppLog. The default value is the same as in the hooklog_enabled option.
-
hooklog_enabled Boolean
Default
logsink_enabledSet whether or not to enable the log tracing.
Note-
In Java Agent 2.2.4 or later, the changed options can be applied without restarting the application.
-
If the
hooklog_enabledvalue has been changed, restarting is required for Java agent versions less than 2.2.4. The default value ofhooklog_enabledislogsink_enabled. Accordingly, iflogsink_enabled=trueis set and the Java application is restarted,hooklog_enabledis set totrue.
-
-
hooklog_custom_methods String
Register a custom log. An arbitrary log framework content is delivered. Use this to trace logs of the log module created on the website.
Javapackage io.home.test;
public class MyLog {
public void customLog(String log) { ... }
}whatap.confhooklog_custom_methods=io.home.test.MyLog.customLog
Setting to exclude a specific log appender
It provides agent options to exclude specific log appenders. The following agent options are provided to exclude specific appenders from monitoring.
-
ignore_logback_appender_set String
Java Agent v2.2.28 or laterIt is the agent option to exclude specific appenders when tracing logback-1.2.8. For example, to exclude
CONSOLEandACCESS_APPENDER, see the following example.whatap.confweaving=logback-1.2.8
# example: ignore 'CONSOLE', 'ACCESS_APPENDER' appender
ignore_logback_appender_set=CONSOLE,ACCESS_APPENDERNote-
If you apply this agent option, you must additionally apply the
weaving=logback-1.2.8option. -
ACCESS_APPENDERis an example value. Specify an appender name that matches your environment.
-
-
ignore_log4j_appender_set String
Java Agent v2.2.28 or laterIt is the agent option to exclude specific appenders when tracing log4j-2.17. For example, to exclude
CONSOLEandACCESS_APPENDER, see the following example.whatap.confweaving=log4j-2.17
# example: ignore 'CONSOLE', 'ACCESS_APPENDER' appender
ignore_log4j_appender_set=CONSOLE,ACCESS_APPENDERNote-
When applying this agent option, you must additionally apply the
weaving=log4j-2.17option. -
ACCESS_APPENDERis an example value. Specify an appender name that matches your environment.
-