Skip to main content

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.

whatap.conf
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.

whatap.conf
watchlog_enabled=true
log_rotation_enabled=true
log_oname_enabled=true
log_keep_days=7
  • watchlog_enabled Boolean

    Default false

    If the value is true, the log monitoring is enabled.

  • watchlog_check_interval Int

    Default 2000

    It 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 8

    It is the maximum count to read logs. It reads as many as watchlog_buffer_size at 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 file name and set multiple words with the delimiter, comma (,). It watches the logs at check_interval and alerts you when any keywords are found. Once an alert has occurred, the occurrence of alert stops for the silent period.

    • 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
  • log_root String

    Default ${WHATAP_HOME}/logs

    Set the agent's log path.

  • log_datasource_lookup_enabled Boolean

    Default true

    The function to record the log is activated in case of DataSource upon InitialContext Lookup.

  • log_rotation_enabled Boolean

    Default true

    The 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 7

    It sets the log file retention period. It works only when the log_rotation_enabled value is true.

  • log_oname_enabled Boolean

    Default false

    If 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.

Caution

The LogSink option is available in whatap.agent-2.1.0 or later.

Enabling the log monitoring function

  • logsink_enabled Boolean

    Default false

    It enables the log monitoring function.

  • logsink_trace_enabled Boolean

    Default false

    Set 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_enabled

    Set 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_enabled value has been changed, restarting is required for Java agent versions less than 2.2.4. The default value of hooklog_enabled is logsink_enabled. Accordingly, if logsink_enabled=true is set and the Java application is restarted, hooklog_enabled is set to true.

  • 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.

    Java
    package io.home.test;

    public class MyLog {
    public void customLog(String log) { ... }
    }
    whatap.conf
    hooklog_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 later

    It is the agent option to exclude specific appenders when tracing logback-1.2.8. For example, to exclude CONSOLE and ACCESS_APPENDER, see the following example.

    whatap.conf
    weaving=logback-1.2.8
    # example: ignore 'CONSOLE', 'ACCESS_APPENDER' appender
    ignore_logback_appender_set=CONSOLE,ACCESS_APPENDER
    Note
    • If you apply this agent option, you must additionally apply the weaving=logback-1.2.8 option.

    • ACCESS_APPENDER is an example value. Specify an appender name that matches your environment.

  • ignore_log4j_appender_set String Java Agent v2.2.28 or later

    It is the agent option to exclude specific appenders when tracing log4j-2.17. For example, to exclude CONSOLE and ACCESS_APPENDER, see the following example.

    whatap.conf
    weaving=log4j-2.17
    # example: ignore 'CONSOLE', 'ACCESS_APPENDER' appender
    ignore_log4j_appender_set=CONSOLE,ACCESS_APPENDER
    Note
    • When applying this agent option, you must additionally apply the weaving=log4j-2.17 option.

    • ACCESS_APPENDER is an example value. Specify an appender name that matches your environment.