jmxtrans / jmxtrans-agent

Java Agent based JMX metrics exporter.
MIT License
179 stars 110 forks source link

Removed initial logging since it interfered with Jenkins logging #31

Closed patbos closed 9 years ago

patbos commented 9 years ago

Tried to use jmxtrans-agent on a Jenkins master and since it started logging with JUL before Jenkins initialized is JUL configuration, the logging in Jenkins became very strange. By just removing the initial logging in the agent logging the issue was resolved.

buildhive commented 9 years ago

jmxtrans project » jmxtrans-agent #46 SUCCESS This pull request looks good (what's this?)

cyrille-leclerc commented 9 years ago

Thanks @patbos, shame on me, I work for CloudBees and I did not test jmxtrans-agent with Jenkins!

I propose to write the message with System.out.println(), would this be ok?

Cyrille

buildhive commented 9 years ago

jmxtrans project » jmxtrans-agent #47 SUCCESS This pull request looks good (what's this?)

patbos commented 9 years ago

No problem, I will not tell anyone at CloudBees ;) Changed to System.out.println instead.

Patrik

cyrille-leclerc commented 9 years ago

Hi @patbos, I checked the code, why would we need to just modify this call and not all the other calls to java.util.logging?

patbos commented 9 years ago

It is the only log call that happens before Jenkins own logging configuration has been initialized. Have not figured out how the logging configuration in Jenkins works but for some reason it will be "corrupted" when calls to java.util.Logger happen before that.

cyrille-leclerc commented 9 years ago

Hello @patbos. Can you try jmxtrans-agent 1.0.8. I replaced java.util.logger by an internal logger framework to prevent these kind of issues.

This internal logger is an alternate solution for the problem that you solved with this pull request.

https://github.com/jmxtrans/jmxtrans-agent/releases/tag/jmxtrans-agent-1.0.8

patbos commented 9 years ago

Thanks! Great stuff! It did the trick for me. I close this PR now.