Logs of java APM agent in the Host

I'm not getting the logs of java APM agent which is running on Linux host. It looks like agent is connected to the apm server as , We are able to see some metrics and details in kibana UI but couldn't see the agent logs.
Any guidance would be highly appreciated.

Hi,

There are two main options:

  1. making the agent log to a file, preferably using the ECS format, then ingest this file with a tool like filebeat, this will require to set log_file=/path/to/agent.log and log_format_file=json in the agent configuration, then configure filebeat for ingestion
  2. use the new log sending feature, which is available with java agent and does not require any additional tool, this will capture the agent logs and the application logs automatically.

thankyou for answering.
can you elaborate the option 1?
Do I need to give the agent log file location while running java -javaagent command?

For the option 1:

  • you can set the log_file (and other agent config options) by adding -Delastic.apm.log_file=/path/to/agent.log
  • if you also set -Delastic.apm.log_format_file=json, this will make ingestion easier by generating an ECS compliant JSON
  • once the agent log file is generated in JSON, you can then use any of the ingestion strategies

The ingestion part will depend if you use ECS (json) format or not, I strongly advise you to read the general application logging guide, while it focuses mostly on the application logs, the same applies to the agent log.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.