Logging configuration optionsedit

log_leveledit

Sets the logging level for the agent.

This option is case-insensitive.

Valid options: ERROR, WARN, INFO, DEBUG, TRACE

Default Type Dynamic

INFO

Level

true

Java System Properties Property file Environment

elastic.apm.log_level

log_level

ELASTIC_APM_LOG_LEVEL

log_fileedit

Sets the path of the agent logs. The special value _AGENT_HOME_ is a placeholder for the folder the elastic-apm-agent.jar is in. Example: _AGENT_HOME_/logs/elastic-apm.log

When set to the special value System.out, the logs are sent to standard out.

Note

When logging to a file, it’s content is deleted when the application starts.

Default Type Dynamic

System.out

String

false

Java System Properties Property file Environment

elastic.apm.log_file

log_file

ELASTIC_APM_LOG_FILE

enable_log_correlationedit

A boolean specifying if the agent should integrate into SLF4J’s MDC to enable trace-log correlation. If set to true, the agent will set the spanId and traceId for the currently active spans and transactions to the MDC. You can then use the pattern format of your logging implementation to write the MDC values to your log file. With the help of Filebeat and Logstash or an Elasticsearch ingest pipeline, you can index your log files and correlate them with APM traces. With this integration you can get all logs belonging to a particular trace and vice-versa: for a specific log, see in which context it has been logged and which parameters the user provided. While it’s allowed to enable this setting at runtime, you can’t disable it without a restart.

Note

This is an incubating feature and the MDC key names might change.

Default Type Dynamic

false

Boolean

true

Java System Properties Property file Environment

elastic.apm.enable_log_correlation

enable_log_correlation

ELASTIC_APM_ENABLE_LOG_CORRELATION