Configure the javaagent to log to a file (instead of stderr)#3413 #15407
-
|
I have a question in relation to the following issue/feature: as well as My apologies if I had to comment on one of above instead of opening a topic in Discussions. I have 2.22.0 agent running in an Application Server with 1.8.0.351 JVM with the following JVM parameters. The "-Dotel.javaagent.logging.file" is a ChatGPT’s idea :)) In general, the agent is doing fine. The data is being collected according to the agent’s configuration file. However, no separate logging file otel.log is created. The agent’s log messages appear in a JVM’s process log file instead. Is io.opentelemetry.javaagent.slf4j.simpleLogger implemented? I’d like to redirect the agent logs because the (my app server’s) proprietary infrastructure seems to kill agent’s logging after some time. In the server’s (JVM’s) log file the agent’s logging is presented but stops eventually after the server start. The last log message is a |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Javaagent debug log isn't particularly useful, consider whether you want it at all. You can see the available configuration options in https://www.slf4j.org/api/org/slf4j/simple/SimpleLogger.html You will have to slightly rename the properties so the property for setting the log file is |
Beta Was this translation helpful? Give feedback.
-
|
Oh, my fault. It works now. Thank you! The Javaagent debug log seems to be quite useful. There are few errors from BeanAttributeExtractor on DEBUG. It may explain why some JVM metrics are missing. Due to errors the log has grown to several hundred MBs in ten seconds or so. It is Ok with relevant modules disabled, but ... it is tricky. |
Beta Was this translation helpful? Give feedback.
-
If you believe you have found a bug create an issue, include a minimal application that reproduces the problem along with any necessary instructions.
In our tests the logs usually don't grow that fast. If you wish someone to take a look consider providing a minimal application that reproduces the issue.
There isn't. |
Beta Was this translation helpful? Give feedback.
Javaagent debug log isn't particularly useful, consider whether you want it at all. You can see the available configuration options in https://www.slf4j.org/api/org/slf4j/simple/SimpleLogger.html You will have to slightly rename the properties so the property for setting the log file is
io.opentelemetry.javaagent.slf4j.simpleLogger.logFile.