Skip to main content

Server

To collect logs by your server application, check the following:

Agent Update

It is available from Server agent 2.1.2. For more information about update, see the following.

Checking the agent settings

Home > Select Project > Log > Log Setting

Select a project in the initial screen of the WhaTap monitoring service, and then select Log > Log Setting under Project Menu. In the OS selection tab at the top of Check Agent CONF., select a server OS (Linux (shell), Windows (Powershell)). See Basic Installation or Install with Category for the process.

The following configuration requires restart of the agent.

Linux Shell

  • Basic installation

    Linux Shell
    export LOGFILES=/some/path/file1,/some/other/file2
    echo "logsink.files=$LOGFILES" | sudo tee -a /usr/whatap/infra/conf/whatap.conf
  • Install with Category

    Linux Shell
    cd /usr/whatap/infra
    sudo mkdir extension

    cat >extension/logsink.conf<<EOL
    [[inputs.logsink]]
    category = "serverlog"
    ## Whether or not to send the data with separate log generation statistics
    stats_enabled = true
    ## Category for log generation statistics
    stats_category = "logsink_stats"
    ## Set the log non-target file names to be excluded with asterisk (*) in the log file path
    excludeNames = [ ".gz",".zip" ]
    [[inputs.logsink.file]]
    ## When setting a log file, you can set the date pattern (strftime.org).
    path = "/some/path/%Y-%m-%d/.log"
    disabled = false
    encoding = "utf-8"

    [[inputs.logsink.file]]
    path = "/some/other/log"
    disabled = false
    encoding = "utf-8"

    [[inputs.logsink.file]]
    ## When searching for the keyword in the line-by-line log, merge it with the previous log.
    nowrap_keywords = ["Caused by:", "Test"]EOL

    sudo service whatap-infra restart

Windows Powershell

  • Basic installation

    Windows Powershell
    $LOGFILES="c:\\whatap\\logs\\%Y-%m-%d\\*.log,c:\\whatap\\logs\\*.log"
    Add-Content "c:\Program Files\WhatapInfra\whatap.conf" -Value "logsink.files=$LOGFILES"
  • Install with Category

    Windows Powershell
    # Require an Administarotr role
    New-Item -type "Directory" -Path "C:\Program Files\WhatapInfra\extension"

    $contentToAdd = @"
    [[inputs.logsink]]
    category = "serverlog"
    ## Whether or not to send the data with separate log generation statistics
    stats_enabled = true
    ## Category for log generation statistics
    stats_category = "logsink_stats"
    ## Set the log non-target file names to be excluded with asterisk (*) in the log file path
    excludeNames = [ ".gz",".zip" ]
    [[inputs.logsink.file]]
    ## When setting a log file, you can set the date pattern (strftime.org).
    path = "c:\\whatap\\logs%Y-%m-%d_.log"
    disabled = false
    encoding = "utf-8"

    [[inputs.logsink.file]]
    ## When searching for the keyword in the line-by-line log, merge it with the previous log.
    nowrap_keywords = ["Caused by:", "Test"]
    "@

    New-Item -path "C:\Program Files\WhatapInfra\extension" -name "logsink.conf" -type "file" -value $contentToAdd -Force

    Restart-Service "Whatap Infra"

Configuring options

  • stats_enabled: Set whether or not to collect the collection status data. The default value is false. The value must be set to true. If set to true, statistical data is generated in the category (logsink_stats) set in the following stats_category.

  • stats_category: Set the metrics category to store the collection status data in. The value must be set to logsink_stats. Statistical data fields are as follows:

    • file
    • checkInterval
    • encoding
    • filepos
    • checkedLocalTime
    • lastupdatedLocalTime
    • fileSize
    • error
    • firstCheck
    • transferBytes
  • excludeNames: By including asterisks (*) in the log file path, you can set the file name to exclude non log files. You can set multiple values using comma (,) as the delimiter.

    Example
    excludeNames = [ ".gz",".zip" ]
  • nowrap_keywords: While searching logs by line, if any keyword is detected by a specified option value, it is merged with the previous log.

Enabling the log monitoring

Home > Select Project > Log > Log Setting

You can enable or disable the WhaTap log monitoring with the toggle button in the Activate log monitoring tab of the Starting the log monitoring section.

Starting the log monitoring

  • If you turn on Icon, the log monitoring is enabled. You can try for free for 15 days from the activation date.
  • If you turn off Icon, the log monitoring is disabled. Logs are no longer saved.

Role

After agent installation, you can enable the log monitoring settings only when you have the edit permission on the project. For more information about the roles, see the following.