I have an appender that I only want the first X characters (for this example, we'll say 5) of the message to display.
I am using a PatternLayout but I can't get the message to truncate the message correctly.
For example, if my log message is
The quick brown fox
I just want to see :
The q
When I use this in the Pattern
%.5m
I get
n fox
since those are the last 5 characters.
I've looked the PattenLayout javadoc, but could not find anything. I know this is a little strange to not want to see the entire message, but for this specific appender it makes sense. I do log the entire message in a different appender. I would like to avoid writing a custom class if possible.