Log4j Stacktrace - Only have certain lines in stacktrace

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Log4j Stacktrace - Only have certain lines in stacktrace

Debraj Manna
In my stacktrace I only want to have lines starting with let's say com.xyz.
Is it possible to have something like the solution discussed in this answer
<https://stackoverflow.com/a/10590950/785523> ?
Reply | Threaded
Open this post in threaded view
|

Re: Log4j Stacktrace - Only have certain lines in stacktrace

Mikael Ståldal-4
On 2017-12-02 16:01, Debraj Manna wrote:
> In my stacktrace I only want to have lines starting with let's say com.xyz.
> Is it possible to have something like the solution discussed in this answer
> <https://stackoverflow.com/a/10590950/785523> ?

As far as I know, it is currently not possible to do this with Log4j.

Feel free to submit a feature request on JIRA:
https://issues.apache.org/jira/projects/LOG4J2

And maybe provide a patch or GitHub PR to implement it:
https://github.com/apache/logging-log4j2/pulls




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Log4j Stacktrace - Only have certain lines in stacktrace

Ralph Goers
If you look at the documentation for the %ex pattern of the PatternLayout [1] you will see that you can do the exact opposite. You can specify packages that you don’t want to see.

Ralph

[1] http://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout <http://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout>

> On Dec 11, 2017, at 12:01 PM, Mikael Ståldal <[hidden email]> wrote:
>
> On 2017-12-02 16:01, Debraj Manna wrote:
>> In my stacktrace I only want to have lines starting with let's say com.xyz.
>> Is it possible to have something like the solution discussed in this answer
>> <https://stackoverflow.com/a/10590950/785523> ?
>
> As far as I know, it is currently not possible to do this with Log4j.
>
> Feel free to submit a feature request on JIRA: https://issues.apache.org/jira/projects/LOG4J2
>
> And maybe provide a patch or GitHub PR to implement it: https://github.com/apache/logging-log4j2/pulls
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>