Closed vlki closed 1 year ago
Hey @vlki ! Well actually, now the level names are determined by their logback representation, as you can see here: https://github.com/logzio/logzio-logback-appender/blob/master/src/main/java/io/logz/logback/LogzioSender.java#L371
Can you give me an example of the configuration you would want? As this is using the slf4j standard which most users would need.
BTW, this could also be achieved by logstash configuration by our side, you can drop us a line in chat and our support team can get that sorted out for you.
Thanks for the quick reply! Its not the actual level names ("error", "warn", ..."), but the log property name. Basically having the "loglevel"
in following piece of code configurable to, in our case, "level"
.
// ...
logMessage.addProperty("loglevel",logLevelName);
// ...
Got you. @asafm WDYS?
And @vlki, as I said, in the meantime you can just ask support to rename that field for you.
@roiravhon Thanks! Renaming not needed on the logstash level, we already have it solved by adding level
property using MDC.
I think we can easily add a configuration for the field names sent in the JSON, thus it will have a map of key fields like:
<fieldNames>
<logLevel>loglevel</logLevel>
<message>message</message>
</fieldNames>
On Tue, Sep 20, 2016 at 5:03 PM Jan Vlček notifications@github.com wrote:
@roiravhon https://github.com/roiravhon Thanks! Renaming not needed on the logstash level, we already have it solved by adding level property using MDC.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/logzio/logzio-logback-appender/issues/10#issuecomment-248310599, or mute the thread https://github.com/notifications/unsubscribe-auth/AA8Y8VS-2hiQKg0S4CFD074b2UY330Otks5qr-e-gaJpZM4KBj8H .
Ok, ill add it in a future release. @vlki Thanks for that!
Sounds great, thanks!
Hey Logz.io team,
first thanks for maintaining this logback appender! We were able to add it into our java/tomcat app right after the MDC support was finished and all works great.
I encountered just one minor issue with the naming. When logging the level to logz.io, it is right now hardcoded to be sent in
loglevel
field, but we are already using propertylevel
when logging from other parts of our platform for signifying the level.We are solving it right now by wrapping the logging into our own methods and adding
level
to MDC right before logging and removing right after like this:But it would be great if such hack is not needed. Any chance the name of log level field might be configurable?