Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-926

Truncate from the end of text format modifier

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.3
    • Component/s: Pattern Converters
    • Labels:
      None

      Description

      In log4j 2, I would like to trim the end of messages written to the console appender when size is above a specified threshold.

      I looked at the http://logging.apache.org/log4j/2.0/manual/layouts.html#PatternLayout docs but can see no option to truncate the end of the "msg" field.

      "%.1000msg" will leave only the last 1000 chars of the message.

      This is not good for me because in Java the most inner frames in stack trace are printed at the beginning of the message.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                davidoh David Ohana
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: