David, Can you please create a Jira issue with this feature request in it? I am not particularly happy with the JsonLayout at the moment as I think what it does is too limited. I’d like there to be a lot more flexibility as to what the resulting JSON should look like, not just dumping the log event.
Ralph > On Dec 22, 2019, at 2:36 PM, J. David Requejo <daren.is...@gmail.com> wrote: > > Hello, > > I'm a big fan of log4j2 and always recommend it in all my professional > projects. > > Lately I have run into an issue while using the log4j2 Json Layout and I > would like to request/contribute a feature. > > The gist is to allow the use of the exception pattern for the throwable by > adding it as a property of those layouts, so you can specify a max number > of lines, or remove the package where the code comes from. > > This comes as when exceptions get logged in Json format, the stack trace is > huge and I am trying to reduce it a bit as the system we use to process the > logs hits a limit on logline size. > > I am new to this so all guidance is welcome. This is the first time I > actually have an idea to contribute to an open source project. From > exploring a bit the code, this is not a fully straightforward change as I > would need to: > - add the new property to the jackson derived formats (it seems to me it > makes sense to have this available for all those, not just the one I want) > - leverage the exception pattern for the logic to serialize the exception > > Thank you, > David