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

CompactJsonFormatter and RenderedCompactJsonFormatter options #52

Closed
rsr-maersk opened this issue Apr 14, 2023 · 3 comments
Closed

CompactJsonFormatter and RenderedCompactJsonFormatter options #52

rsr-maersk opened this issue Apr 14, 2023 · 3 comments

Comments

@rsr-maersk
Copy link

Hi, thanks for an awesome package. Request to make a PR / feature change.

We are logging with Serilog via a common adapter to loki.. With CompactJsonFormatter and RenderedCompactJsonFormatter as the formatter.

We would like veryt much that information level is always added to the message. and we can rename the default @fields to specific values. Yes, we can use the ExpressionTemplate formatted also. But this does not include the convenient logic included in the CompactJsonFormatter and RenderedCompactJsonFormatter.

Can I make a PR to add options to the ctor for CompactJsonFormatter and RenderedCompactJsonFormatter? Then ppl can control some behaviour, but keep the default as is?

@nblumhardt
Copy link
Member

Hi, thanks for dropping us a line!

But this does not include the convenient logic included in the CompactJsonFormatter and RenderedCompactJsonFormatter.

What's missing from ExpressionTemplate? Thanks!

@generik0
Copy link

generik0 commented Apr 16, 2023

Hi.

I think your main problem is, that using the expression template means we need to change code in 100+ microservices.

But I guess it isn't much of an arguement when we would need to change to use the nine default ctor I propose also.

Our problem is concrete when using Grafana and the log level not being present.
If info level, grafana doesn't adds info.

image

@nblumhardt
Copy link
Member

Hi! Thanks for the extra info. This really seems like a configuration management problem - deploying new logger configuration to 100 microservices is going to need some supporting infrastructure.

Closing as a duplicate of #20, but if you need any help with getting ExpressionTemplate (or a copy of CompactJsonFormatter) set up to your liking, please let me know. Thanks!

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

No branches or pull requests

3 participants