Hello,

Some time ago, I had submitted a feature request for Log4j 1.x which I never 
got around to actually implementing:
https://issues.apache.org/bugzilla/show_bug.cgi?id=51122

I see that this feature request would apply to the new Log4j 2.x source as well:
http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java?view=markup

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":
[ThrowablePatternConverter.java:115] 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:
https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java
https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java

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 
(https://issues.apache.org/jira/browse/LOG4J2).  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?

Thanks,
Joanne
                                          

Reply via email to