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.
Adding log file to process group
To manually add a log file to a process group
- In the Dynatrace menu, select Technologies and processes and a process group.
- From the process group page, select the process instance for which you want to add a new log file.
- In the Log files section of the page, select the Configure more log files link.
Alternatively, look for the No log sources detected section if no log files are associated with the process. - On the Process group settings page, select the Log monitoring tab.
- Select Add new log for monitoring.
- Type the file path of the log file to be associated with this process group. Only absolute paths are allowed.
- Check out the requirements to the logs paths to make sure they are supported.
- Make sure you enable monitoring of the added log file(s).
- Select Save.
Windows event logs
Standard Windows event logs are already automatically detected, so you don't have to manually add the following:
Windows Security Log
Windows Application Log
Windows System Log
IIS Event Logs
To manually add a custom Windows event log file to a process
-
In the Dynatrace menu, select Hosts.
-
Select the host that contains the Windows event log file.
-
From the Processes section of the overview of the host page, select the process for which you want to add a new log file.
Optionally, in the Dynatrace menu, go to Technologies and processes, select a process group, and then, from the process group page, select the process instance for which you want to add a new log file. -
In the Log files section, select Add more.
-
On the Manually added process logs page, select Add new log for monitoring
-
Provide the log name followed by the
.evtx
file extension.
You can use the built-in Windows Event Viewer to find the custom log name. Make sure that you provide the full path. -
Select Save.
Considerations for adding text log files manually
Dynatrace supports log files that were updated (written to) in the last 7 days AND meet at least one of the following criteria:
-
Files are located in a directory called
log
orlogs
(up to 2 levels) or/var/log/
.
OK (level 1):
c:\...\logs\custom.txt
c:\...\log\custom.txt
OK (level 2):
c:\...\logs\app1\custom.txt
c:\...\log\app2\custom.txt
NOT OK (level 3 and above):
c:\...\logs\app1\app11\custom.txt
c:\...\log\app2\app22\custom.txt
-
Custom log path must specify files, not a directory:
NOT OK:
/var/log/customdir/
-
Custom log paths files must not start or end with a wildcard ( * )
NOT OK:
/var/log/customdir/*
/var/log/customdir/file*
/var/log/customdir/*.log
-
Files have the extension
.log
,-log
,_log
(for example,apache.log
,apache.myapp-log
,apache.myapp_log
) -
Every file that has other extension, such as
.txt
, is supported if its names contains the.log
,-log
, or_log
prefix that is preceded by at least one character or symbol (for example,apache.log.txt
,apache-log.txt
, orapache_log.txt
)
Note: Thelog.txt
alone file is not accepted (unless placed in thelog
orlogs
directory). -
File name is
catalina.out
Remember that, after you configure custom log paths, make sure the log files are added to log storage. See, Log sources and storage
Additionally:
- Only absolute file paths are supported:
- Unix: Path must begin with
/
.
Paths within the following folders are not supported:
etc boot proc dev bin sbin lib usr .ssh
- Windows: Path must begin with drive letter (for example,
C:\
).
Paths within the following folders are not supported:
windows winnt
- Unix: Path must begin with
- Manually added log files affect all processes on all hosts belonging to the configured process group.
- To add log files located in a container:
- Configure the container so that the log file within the container is written to a disk.
- Point the OneAgent to this location by defining the absolute path to where the container is to write the log files.
-
You can add numbered rotating-log filesets by using the hash character (#).
For example,/var/log/error-#.log
will matcherror-1.log
,error-2.log
, etc., and report the fileset as a singleerror-#.log
file. -
You can globally disable the option to configure custom log files by setting:
AppLogRemoteConfiguration = false
On Linux:
/var/lib/dynatrace/oneagent/agent/config/ruxitagentloganalytics.conf
On Windows:
%PROGRAMDATA%\dynatrace\oneagent\agent\config\ruxitagentloganalytics.conf
If your OneAgent installation, freshly installed or upgraded, does not have the ruxitagentloganalytics.conf
file, use ruxitagentloganalytics.conf.template
as a template and create your own ruxitagentloganalytics.conf
file. Next, copy the ruxitagentloganalytics.conf
file to the following directory:
- Linux:
/var/lib/dynatrace/oneagent/agent/config/
- Windows:
%PROGRAMDATA%\dynatrace\oneagent\agent\config\