How do I enable log analytics?

Enable access to log content

To enable existing instances of Dynatrace OneAgent to access log content, log into the monitored host and set:

AppLogContentAccess = true

On Linux:

Dynatrace OneAgent versions 103 and later: /var/lib/dynatrace/oneagent/agent/config/ruxitagentloganalytics.conf

Dynatrace OneAgent versions 102 and earlier:
/var/lib/ruxit/agent/config/ruxitagentloganalytics.conf

On Windows:

Dynatrace OneAgent versions 103 and later: C:\ProgramData\dynatrace\oneagent\agent\config\ruxitagentloganalytics.conf

Dynatrace OneAgent versions 102 and earlier: C:\ProgramData\ruxit\agent\config\ruxitagentloganalytics.conf

Dynatrace OneAgent restart is not required.

New installations

By default, log analytics is enabled by your Dynatrace administrator during Dynatrace OneAgent installation. If for any reason you don’t want to allow access to log files on a particular host, you can disable log analytics for that host during Dynatrace OneAgent installation. In the Linux installation example below, note the Enable access to monitored processes log files content on this host switch. Disable this setting to turn off log access for this host. The Dynatrace OneAgent installer for Windows provides the same option.

For both operating systems, Dynatrace OneAgent installation provides support for the APP_LOG_CONTENT_ACCESS parameter, which sets log access to either enabled or disabled based on the state of this switch.

Enable log analytics

Dynatrace log analytics is disabled by default.

To enable log analytics globally

  1. Open the left-hand navigation menu and select Settings.
  2. Select Monitoring > Monitored technologies.
  3. Set the Log analytics switch to the On position.

To enable log analytics only for an individual host

  1. Open the left-hand navigation menu and select Hosts.
  2. Select a host.
  3. Click the Edit button.
  4. Set the Log analytics switch to the On position.

User rights for log analytics

Logs often contain sensitive information that may not be appropriate for all users to see. For this reason your Dynatrace administrator must enable the View logs account-security option in your user profile. This option is disabled by default for all non-admin users. It must be explicitly enabled to access log contents.

Auto-discovery of log content

By default, Dynatrace auto-discovers all new log files.

If for any reason you don’t want Dynatrace to automatically discover new log files on a specific monitored host, set:

AppLogAutoDetection = false

On Linux:

Dynatrace OneAgent versions 103 and later: /var/lib/dynatrace/oneagent/agent/config/ruxitagentloganalytics.conf

Dynatrace OneAgent versions 102 and earlier:
/var/lib/ruxit/agent/config/ruxitagentloganalytics.conf

On Windows:

Dynatrace OneAgent versions 103 and later: C:\ProgramData\dynatrace\oneagent\agent\config\ruxitagentloganalytics.conf

Dynatrace OneAgent versions 102 and earlier: C:\ProgramData\ruxit\agent\config\ruxitagentloganalytics.conf

OneAgent restart is not required.

Add log files manually

Dynatrace allows you to add specific log files manually in instances where the files aren’t discovered automatically. You only need to add one log path at the process-group level to cover all processes within the group across all monitored hosts.

To manually add a log file to a process group:

  1. Open the left-hand navigation menu and select Hosts.
  2. Select a host.
  3. From the Processes section of the page, select the process for which you want to add a new log file.
  4. In the Log files section of the page (alternatively, look for the No log files section if no log files are associated with the process), click the Configure more log files link.
  5. On the Process group settings page, select the Log monitoring tab.
  6. Click Add new log file for monitoring.
  7. Type the filepath of the log file to be associated with this process group. Only absolute paths are allowed.
  8. Click Save.

Considerations for adding log files manually

Dynatrace supports log files that meet at least one of the following criteria:

  • Files are located in a directory called log or logs (limited up to 2 levels) or /var/log/.

Okay: C:\Program Files\MyApp\logs\aaa.txt

Okay:


\*\*Not okay:\*\*
```C:\Program Files\MyApp\logs\other\out\ccc.txt
  • Files have the extension .log (for example, apache.log).
  • File names end with [.-_]log (for example, apache_log.txt, apache.log.txt, or apache-log.txt).

Additionally:

  • Only absolute file paths are supported:
    • Unix: Path must begin with /. Paths within etc, boot and proc are not supported.
    • Windows: Path must begin with drive letter (for example, C:\). Paths within windows and winnt are not supported.
  • Manually-added log files affect all processes on all hosts belonging to the configured process group.
  • You can add a set of files in the folder by using a wildcard (for example, /var/log/apache/access-*.log). All files will be reported separately.
  • You can add numbered rotating-log filesets by using the # character (for example, /var/log/error-#.log will match error-1.log, error-2.log, etc and report the fileset as a single error-#.log file).
  • You can globally disable the option to configure custom log files by setting:

AppLogRemoteConfiguration = false

On Linux:

Dynatrace OneAgent versions 103 and later: /var/lib/dynatrace/oneagent/agent/config/ruxitagentloganalytics.conf

Dynatrace OneAgent versions 102 and earlier:
/var/lib/ruxit/agent/config/ruxitagentloganalytics.conf

On Windows:

Dynatrace OneAgent versions 103 and later: C:\ProgramData\dynatrace\oneagent\agent\config\ruxitagentloganalytics.conf

Dynatrace OneAgent versions 102 and earlier: C:\ProgramData\ruxit\agent\config\ruxitagentloganalytics.conf