I have Springboot application. I want to configure log correlation with APM. I have specfied %X{trace.id} in Log pattern to get correlation Id.
I tried to setup with APM setup Manual setup with -javaagent flag then I am getting %X{trace.id} as blank.
java -javaagent:elastic-apm-agent-1.18.0.RC1.jar -jar -Delastic.apm.service_name=TEST-SERVICE -Delastic.apm.server_urls=http://192.168.0.11:8200 -Denvironment=Development -Dprofiling_inferred_spans_enabled=true -Denable_log_correlation=true target/test-0.0.1-SNAPSHOT.jar
Then I thought to setup Programmatic API setup to self-attach then I am getting %X{trace.id}.
java -jar target/test-0.0.1-SNAPSHOT.jar
Please help me with this behaviour as I don't want to keep elastic-apm dependency in code and want to go with -javaagent way.