Yes - this all sounds good to me.


On Feb 1, 2013, at 11:27 AM, Joanne Polsky wrote:

Thanks Ralph and Gary, that makes more sense.  I indicated it would default to "\n" since that is what is hard coded in the source now.  I can update to Constants.LINE_SEP while adding this new feature.

The ThrowablePatternConverter currently doesn't parse the filters, so having delim as it's own option may be simpler in the end.  I would think the following patterns should be supported:

%throwable{full}{delim( | )}
%throwable{delim( | )}
%xThrowable{full}{filters(package1,package2)}{delim( | )}
%xThrowable{full}{delim( | )}
%xThrowable{delim( | )}

Also the delim could be more than one character, for instance we use space+pipe+space as our separator.

Would those patterns make sense?


Subject: Re: Feature Request from 1.x: Include option in throwable pattern converter to control stack trace separator
Date: Fri, 1 Feb 2013 11:19:35 -0800

Yes.  That is available as Constants.LINE_SEP.


On Feb 1, 2013, at 11:03 AM, Gary Gregory wrote:

Shouldn't the default be the line.separator system property?


On Fri, Feb 1, 2013 at 1:54 PM, Ralph Goers <> wrote:
First, thanks for participating!  The process you are following is perfectly fine.  It is always great to start a discussion of a new feature on the dev list to work out any details.  You can create a Jira with the feature request and then attach a patch once you have completed the work.  Assigning the Jira to yourself lets us know that you plan to work on it so that is a good idea.

We could either use the syntax you are proposing or 


which would be a little shorter.  In both cases I would expect specifying the filters should be optional if the delimiter is included.

FWIW, this change will be a bit more extensive than just changing line 115.  The extended throwable pattern converters do most of their formatting in ThrowableProxy, so it would need to be made aware of the delimiter.


On Feb 1, 2013, at 9:54 AM, Joanne Polsky wrote:


Some time ago, I had submitted a feature request for Log4j 1.x which I never got around to actually implementing:

I see that this feature request would apply to the new Log4j 2.x source as well:

Now that I actually have some time, I'd like to make this contribution if no one has any concerns.

Essentially the change is to make the appended new line configurable to be any string delimiter default being "\n":
[] sb.append(array[i]).append("\n");

I had originally thought that a pattern like the following might work "%throwable{full}{ | }".  However, it looks like in 2.0, there are some classes which extend the ThrowablePatternConverter that assume the second option may be a list of filters:

I was thinking I could still implement this change in ThrowablePatternConverter where it would iterate through the options looking for the specific prefix of delim?  So for instance the user would specify something like the following (not sure if I like that delim but I can't think of another identifier):
%throwable{full}{delim( | )}
%XThrowable{full}{filters(package1,package2)}{delim( | )}
%rThrowable{full}{filters(package1,package2)}{delim( | )}

This would be my first contribution to any Apache software if this feature was accepted so I'm not exactly sure how to proceed if I'm interested in making the contribution myself.  I guess the first step would be to to copy the feature request from the 1.0 bugzilla to the 2.0 JIRA (  Is there some approval process for the feature before I start implementing the change?  Or would I simply assign the JIRA to myself, make the code change I think makes sense, then submit for code review?


E-Mail: | 
JUnit in Action, 2nd Ed:
Spring Batch in Action: