sls logging with sessionId#162
Conversation
Generate changelog in
|
✅ Successfully generated changelog entry!Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview✨ Features
|
There was a problem hiding this comment.
Can we add docs to the readme of this repo explaining how logging works with it? Specifically would want to note that this logback.xml file is what dictates log level/layout/etc., and how they can override if needed.
There was a problem hiding this comment.
Changed the approach to not use a logback.xml in the lib as that's apparently an anti-pattern but added to the readme how to overwrite the layout.
| * Not required, if unused the default SLS JSON layout will be used. Provide a custom Logback layout | ||
| * to change the log output format. | ||
| */ | ||
| public ComputeModuleBuilder withLayout(Layout<ILoggingEvent> newLayout) { |
|
|
||
| - Outputs to **STDOUT** using the SLS (`service.1`) JSON layout | ||
| - Sets the root log level to **INFO** | ||
| - Automatically includes `session_id`, `job_id`, and `pid` in every log line via MDC |
There was a problem hiding this comment.
Last nit: might want to explain session_id == replica ID? Unless we already mention that in docs elsewhere
There was a problem hiding this comment.
Added to the readme but not going into a lot of detail here since I think that detail is more important when looking at Compute modules in general (not Java specific). Thus, we should add some more details on this and the updated lib on the documentation page as well.
Before this PR
No SLS logging and no sessionId logged
After this PR
sessionId is being logged in SLS format
Possible downsides?