[ https://issues.apache.org/jira/browse/LOG4J2-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14949977#comment-14949977 ]
Christian Möller commented on LOG4J2-1152: ------------------------------------------ Good idea: Providing the user a second (optional) parameter to choose the replacement string is convincing. The default I choose stems from the newsletter of Heinz Kabutz (as stated in the description of the issue). It gives you a reasonable chance to undo the replacement operation - e.g. via {noformat}sed 's/ |\>\> /&\ /g'{noformat}; I think this could be very useful, think of showing some Java developer a strack trace "streamlined" ... Depending on the context there might be shorter alternatives like "> ", but handling multi-line XML/HTML this way would produce weird stuff - without a reasonable way of undoing. > Add %oneLine to PatternLayout to mask line breaks for easier processing of > log messages > --------------------------------------------------------------------------------------- > > Key: LOG4J2-1152 > URL: https://issues.apache.org/jira/browse/LOG4J2-1152 > Project: Log4j 2 > Issue Type: New Feature > Components: Pattern Converters > Reporter: Christian Möller > Assignee: Gary Gregory > Attachments: OneLinePatternConverter.java > > > Adding %oneLine\{...\} to PatternLayout will mask line breaks of enclosed > Strings as " |>> ". For instance, %oneline{%exception{full}} will convert > stack traces to a one-liner easier to handle with tools like grep. Based on > an idea of Heinz Kabutz: http://www.javaspecialists.eu/archive/Issue177.html -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org