Closed sgrimm-sg closed 6 years ago
@adavisvivint Any chance this will be merged soon? The example logback.xml
states you can already add a layout: https://github.com/scalyr/scalyr-logback/blob/master/samples/logback.xml#L20
@adavisvivint It appears some of this PR was added at this commit recently - https://github.com/scalyr/scalyr-logback/commit/b608da4e8e495110978f33621776a4b8a789c0b3
Are there plans to update maven with latest change?
This PR should be closed - I did a separate PR that uses the layout and that was merged in. @chrsblck I don't have permissions to publish to Maven Central but I imagine @steve-scalyr can do that or has already done that.
This PR does four things:
Seems like b608da4 only does the first of those things, unless I'm missing something.
Happy to abandon this if people think there's no value in the remaining three features, or I can rework it based on the current version of the library.
@sgrimm-sg @adavisvivint the main thing we were after in this PR was support for Layout.
Sorry we haven't been responsive on this comment thread yet. It sounds to me like features #2 and #3 (Publishing on the MDC
and Publishes the thread name
) would still be useful to add in. I wouldn't suggest we add in the last one (splitting up long log messages) since we are working to solve the log message problem on the server-side, and leaving it to the server to split the messages will work better in the long run (once we have the improved server-side support).
How does that sound? Once this PR Is updated, I'll be happy to merge and push out to maven.
Thanks to everyone for contributing to the library.
Server-side support for long log messages sounds great -- what I did here was, obviously, a hack and I'll be glad when it's no longer needed. I'll try to find time soon to update this PR to only include the attribute changes.
Cleaning up - closing this PR at adavisvivint's request
Custom layouts may be specified using Logback "Layout" objects.
Long messages are split into pieces with a configurable prefix on the second through Nth pieces, to avoid truncation due to the log message length limit. If possible, the splitting is done at newline boundaries so as not to chop lines in half in stack traces or other multi-line messages.
MDC properties and thread names are automatically included as attributes on log messages.