Where can I find OneAgent files and logs?

You may at some point want to access the installed agent binaries, configuration files, and log files (for example, for support purposes). Here's where you can find these files.

By default your Dynatrace OneAgent is installed in the following directory:

  • On 64-bit Windows C:\Program Files (x86)\dynatrace\oneagent
  • On 32-bit Windows C:\Program Files\dynatrace\oneagent
  • On Linux /opt/dynatrace/oneagent

Exception for versions 102 and earlier

Log files

Log files are stored by default:

  • On Linux at /opt/dynatrace/oneagent/log
  • On 64-bit Windows at C:\Program Files (x86)\dynatrace\oneagent\log
  • On 32-bit Windows at C:\Program Files\dynatrace\oneagent\log
  • On Azure
    • at D:\home\DynatraceOneAgent\log
    • and D:\home\SiteExtensions\Dynatrace\log.txt
  • On Cloud Foundry Java at <path-to-app-container>/.java-buildpack/ruxit_agent. Please note you can stream logs in Cloud Foundry via CLI cf logs app-name

Logging for iOS

You can enable logging for iOS by adding the following snippet to Info.plist or Dynatrace.plist.

<key>DTXLogLevel</key>
<string>FINER</string>

Info.plist can be found in the Xcode Project Navigator under Supporting Files (or under Resources for older project files). Dynatrace.plist is created by the developers if they want to keep the Info.plist clean, so the location can vary.

Available log levels are ALL, FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE, OFF.

When running the app, you'll find the log in Xcode within the console of the Debug area.

Logging for Android

Logging for Android involves two different logs:

  • log from the auto-instrumentor
  • log from OneAgent

Log from the auto-instrumentor

The auto-instrumentor publishes the debug logs into the console and into the auto-instrumentor log file (the file name starts with AIA and the current date). The log file is stored in the logs directory (root folder is the current working directory). To obtain the debug logs, the auto-instrumentation property DTXLogLevel has to be added using the scripts instrument.sh/instrument.cmd.

  • Via Dynatrace Gradle plugin: add the auto-instrumentation property DTXLogLevel':'debug' through the Dynatrace Gradle plugin property agentProperties to the Dynatrace configuration block in the build.gradle file. When the Android build process is triggered via the "Run" button from Android Studio, the console logs are displayed in the Gradle Console view. The log file is stored in the <project>/<module>/build/tmp/autoInstrument<build_variant>/logs directory.

  • Via console: add the auto-instrumentation property DTXLogLevel=debug to the auto-instrumentor Dynatrace.properties file.

Log from OneAgent

To obtain the debug log for OneAgent from an app when DTXLogLevel=debug is enabled:

  1. Connect the device to your PC (or run the emulator). Check that your device is setup for development.
  2. Launch the command prompt/terminal.
  3. Run adb shell logcat > MyAndroidAppLog.txt For details, see Logcat.
  4. Launch the instrumented app with the new debug flags.

Alternatively,

  1. Connect the device to your PC (or run the emulator). Check that your device is setup for development.
  2. Open the Logcat view in Android Studio (and select device).
  3. Configure the Dynatrace OneAgent logcat filter with the regex (dtx|caa-a).* for the Log Tag field.
  4. Launch the instrumented app with the new debug flags.
  5. Extract/print log into a file.