Unable to generate log file for Elastic Java agent


I am using elastic java agent 1.49 for tracing a containerized application with docker.
I have some spans being dropped out and to debug the same, Enabled the logs to trace mode for the agent.

However , I am unable to generate the logs file for the agent. below are the combination of properties I have tried out:

  1. -Delastic.apm.log_level=trace -Delastic.apm.log_file=./logs/elastic-apm.log
  2. -Delastic.apm.log_level=trace -Delastic.apm.log_file=AGENT_HOME/logs/elastic-apm.log
  3. -Delastic.apm.log_level=trace -Delastic.apm.log_file=AGENT_HOME/elastic-apm.log
  4. -Delastic.apm.log_level=trace -Delastic.apm.log_file=$_AGENT_HOME/logs/elastic-apm.log

None of the above generated the log file. Tried giving full permissions to the path as well.

Am i missing any other configurations required with the log properties mentioned above or Is there any other way to get the agent logs in a file system.

Kindly advise.

Thanks & Regards,
Namita Jaokar


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

Hi @Jack_Shirazi ,

Thankyou for your response.
Correction from my previous comment , the editor took it the special character "_" from the _AGENT_HOME_ as an italic formatter and hence the typo.

I had provided _AGENT_HOME_ in the property configuration , referring to the same link that you have provided but unfortunately it does not work for me.

is there anything i am missing on.

Best Regards,
Namita Jaokar

To be clear, you are running in the docker image and you are building the image with those parameters and when you run the image you interactively shell into the image and look in the image directory where the jar is and it's not there? And you've checked the write perms to that directory for the user the JVM is running under?

yes, Its not there in the jar directory and neither is the agent jar. Have given permissions to the directory and tried as well.

Best Regards,

What does the docker output show? There would be error output of some kind