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

High-water-mark batching of messages #6

Open
jhannes opened this issue Feb 13, 2019 · 2 comments
Open

High-water-mark batching of messages #6

jhannes opened this issue Feb 13, 2019 · 2 comments
Labels
high priority Deficiency compared to other logging options

Comments

@jhannes
Copy link
Owner

jhannes commented Feb 13, 2019

Batch up messages in a context and process all only if at least one was over a given threshold. This is useful to get the full context of an error situation.

This can probably be implemented with MDC.put and MDC.remove acting as the boundaries.

Possible configuration syntax:

observer.fooObserver=BatchingLogEventObserver
observer.fooObserver.mdcKey=FOO
observer.fooObserver.reportThreshold=ERROR
observer.fooObserver.includeThreshold=INFO
observer.fooObserver.batchProcessor=SlackLogEventBatchProcessor

(Suggested by Axel Fontaine)

@jhannes jhannes added the high priority Deficiency compared to other logging options label Feb 13, 2019
@jhannes
Copy link
Owner Author

jhannes commented Feb 13, 2019

In order to avoid spam to high-intrusion channels (Slack, Email), this must be possible to combine with the cooldownTime. But that means that there is a risk that more MDC-batches will be included in the same report. (For example if a client spams with requests that cause errors) The events must probably be grouped somehow on the mdcKey.

@jhannes
Copy link
Owner Author

jhannes commented Apr 9, 2021

It would be nice to set loglevel on a logger based on mdc values. E.g.

logger.org.foo.bar=INFO,TRACE@mdc:user=testing console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority Deficiency compared to other logging options
Projects
None yet
Development

No branches or pull requests

1 participant