https://issues.apache.org/bugzilla/show_bug.cgi?id=51122
Summary: Include option in throwable pattern converter to
control stack trace separator
Product: Log4j
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Layout
AssignedTo: [email protected]
ReportedBy: [email protected]
We have software which scans our log files for errors/warns and sends the
appropriate alerts to our on-call team. It would be convenient if we could
control the stack trace separator when the exception is logged.
I initial wrote our own custom PatternParser/PatternConverter from the core
log4j code base, which used a %S{ | } pattern field, however, since there is
already an EnhancedPatternParser in a companion class which has a %throwable
specific pattern field, which is exactly what I was trying to accomplish, it
seems like it makes more sense to extend that class rather than maintain our
own.
The change would be to include an additional (optional) option to
ThrowableInformationPatternConverter which sets the trace separator rather than
use a hard coded new line, where new line would be the default if not
specified.
http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/pattern/ThrowableInformationPatternConverter.java?view=markup
The pattern could then be extended like the following:
%throwable{full}{ | }
It appears that the code will already provide additional options to the pattern
converter constructor if they are chained together. For this to work, however,
the second option would always have to be the stack trace separator, unless
there is a way to prefix an option to identify it as the stack trace separator.
Since the idea of the pattern is to have greater control on statement logging,
it seems like the responsibility to control the stack trace separator should
also live within this class.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]