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

Prefix-based log routing #181

Open
SevereOverfl0w opened this issue Oct 7, 2020 · 1 comment
Open

Prefix-based log routing #181

SevereOverfl0w opened this issue Oct 7, 2020 · 1 comment

Comments

@SevereOverfl0w
Copy link

I like to route my application logs to their own file to aid debugging. All my logs are done using slf4j, so there's very little use of markers to be converted into tags. Would it be possible to support some kind of prefix such that I could say that either:

  • Only com.myapp logs go into this file
  • com.myapp is tagged as "APP", and then use that to do the routing

Right now, we achieve this with logback, but tinylog's benchmarks and simple configuration are alluring. Although I'm yet to test the benchmarks when used in conjunction with slf4j, I have no idea what kind of overheads would be present.

@pmwmedia
Copy link
Member

You can archive this with the current tinylog version by creating your custom logging provider. Just extend TinylogLoggingProvider and override both log() methods. There, you can modify the tag and map com.myapp to the tag "APP".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants