Skip to content

sls logging with sessionId#162

Merged
PaulJKathmann merged 3 commits into
developfrom
pk/sls
Mar 17, 2026
Merged

sls logging with sessionId#162
PaulJKathmann merged 3 commits into
developfrom
pk/sls

Conversation

@PaulJKathmann

Copy link
Copy Markdown
Contributor

Before this PR

No SLS logging and no sessionId logged

After this PR

sessionId is being logged in SLS format

Possible downsides?

@changelog-app

changelog-app Bot commented Feb 20, 2026

Copy link
Copy Markdown

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

sls logging with sessionId and job Id in params

Check the box to generate changelog(s)

  • Generate changelog entry

@PaulJKathmann PaulJKathmann marked this pull request as ready for review March 17, 2026 15:54
@changelog-app

changelog-app Bot commented Mar 17, 2026

Copy link
Copy Markdown

Successfully generated changelog entry!

Need to regenerate?

Simply interact with the changelog bot comment again to regenerate these entries.


📋Changelog Preview

✨ Features

  • sls logging with sessionId and job Id in params (#162)

Comment thread lib/src/main/resources/logback.xml Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread lib/src/main/resources/logback.xml Outdated
* 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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:chefskiss:

Comment thread README.md Outdated

- 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Last nit: might want to explain session_id == replica ID? Unless we already mention that in docs elsewhere

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@PaulJKathmann PaulJKathmann merged commit a7d9321 into develop Mar 17, 2026
5 checks passed
@scottkruyswyk scottkruyswyk deleted the pk/sls branch March 17, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants