title: Limit max message size in log4j2 pattern
body: <p>In log4j 2, I would like to trim <strong>the end</strong> of messages written to the console appender when size is above a specified threshold.</p>
  
  <p>I looked at the <a href="http://logging.apache.org/log4j/2.0/manual/layouts.html#PatternLayout" rel="noreferrer">http://logging.apache.org/log4j/2.0/manual/layouts.html#PatternLayout</a> docs but can see no option to truncate the end of the "msg" field.</p>
  
  <p>"%.1000msg" will leave only the <strong>last</strong> 1000 chars of the message.</p>
  
  <p>This is not good for me because in Java the most inner frames in stack trace are printed at the beginning of the message.</p>
  
  <p>Any idea?</p>