Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing universal logger #16

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

alexzerntev
Copy link

@alexzerntev alexzerntev commented Nov 12, 2024

Added scala and java key-value pair logger

  • The raw loggers are built on top of normal loggers. In scala it can be used in an exact same way as StrictLogging. The PR is backward compatible so we can gradually switch to the new logger. Java logger uses the decorator pattern and wraps internally the org.slf4j logger

Copy link
Contributor

@miguelbranco80 miguelbranco80 left a comment

Choose a reason for hiding this comment

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

Some issues to think about...

private val TRACE_ID = "traceId"
}

trait TraceIdLogging extends ContextLogging {

Choose a reason for hiding this comment

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

If one inherits the TraceIdLogging trait, it can set the trace ID with the dedicated methods (as the name indicates), but also has access to the inner ContextLogging methods that permit to add any random key to MDC. Just wondering if that could be a problem.

Copy link

@bgaidioz bgaidioz left a comment

Choose a reason for hiding this comment

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

The interface and what it leads to in the log files looks convenient.

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.

3 participants