https://issues.apache.org/bugzilla/show_bug.cgi?id=46483
Summary: Truncating the end of the log message using a
PatternLayout
Product: Log4j
Version: 1.2
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Layout
AssignedTo: [email protected]
ReportedBy: [email protected]
I have an appender that I only want to display the first X characters (for this
example, we'll say 5) of the message.
I am using PatternLayout, and I can only get the message to truncate from the
end, which displays the last X characters.
For example, if my log message is "The quick brown fox" I want to see "The q"
(first 5 characters). If I use the pattern, "%.5m" I get "n fox" (last 5
characters).
I would expect that the pattern, "%-.5m" would accomplish this. However, this
also returns "n fox" (last 5 characters). When dealing with padding, the "-"
character changes the padding from left to right.
--
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]