Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Capture all logs and errors in the Pantheon log output #1437

Merged
merged 3 commits into from May 13, 2019

Conversation

ajsutton
Copy link
Contributor

@ajsutton ajsutton commented May 12, 2019

PR description

Pantheon uses some libraries that log to SLF4j but we didn't include a binding from SLF4j to Log4J at runtime so those logs were silently dropped. Include the binding so the libraries log correctly and we don't get an annoying warning about missing the binding at startup.

Additionally, set a default exception handler at the start of our main method so any uncaught exceptions are output to our logging rather than printed to system error which may get missed if a simple redirect is used.

…that log to slf4j have their logs output to Pantheon's logs properly.
@ajsutton ajsutton requested a review from CjHare May 12, 2019 23:07
@ajsutton ajsutton changed the title Fix logging for libraries using SLF4j Capture all logs and errors in the Pantheon log output May 12, 2019
Copy link
Contributor

@CjHare CjHare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to use the LogManager.getLogger() consistently across Pantheon (IMHO the cleanest & least prone to copy & paste error) to get a LOG ...if that's not already happened

@ajsutton
Copy link
Contributor Author

There was a pass done to use LogManager.getLogger() consistently a while back. I think its pretty consistent but there are probably some exceptions.

@ajsutton ajsutton merged commit a453610 into PegaSysEng:master May 13, 2019
@ajsutton ajsutton deleted the fix-slf4j branch May 13, 2019 01:02
notlesh pushed a commit to notlesh/pantheon that referenced this pull request May 14, 2019
* Add slf4j to log4j bindings as a runtime dependency so any libraries that log to slf4j have their logs output to Pantheon's logs properly.

* Set a default exception handler to ensure uncaught exceptions wind up in the Pantheon logs.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants