[jira] [Commented] (LOG4J2-774) NdcPatternConverter breaks Log4j 1.2.x layout
[ https://issues.apache.org/jira/browse/LOG4J2-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15390801#comment-15390801 ] Gary Gregory commented on LOG4J2-774: - Hello [~WIFE_IT], Do you plan on providing a patch to make the behavior configurable along the lines of that Remko suggests? Gary > NdcPatternConverter breaks Log4j 1.2.x layout > - > > Key: LOG4J2-774 > URL: https://issues.apache.org/jira/browse/LOG4J2-774 > Project: Log4j 2 > Issue Type: Bug > Components: Layouts >Affects Versions: 2.0.1 >Reporter: Frank Wißmann >Priority: Minor > Labels: patch > Attachments: NdcPatternConverter.java.patch > > > In Log4j 1.2.17 NdcPatternConverter.format() returns an empty string "" or > the stack messages separated by space "a b c" > (NDC.DiagnosticContext.fullMessage). > The PatternLayout \[%20.20x\] results in > {code}[]{code} or {code}[ a b c]{code}. > In Log4j 2.0.1 NdcPatternConverter.format() returns an unmodified > Collection.toString() representation: "\[\]" for an empty collection or the > collection separated by comma "\[a, b, c\]" > (DefaultThreadContextStack.toString() and > MutableThreadContextStack.toString()). > The PatternLayout \[%20.20x\] results in {code}[ []]{code} > or {code}[ [a, b, c]]{code}. -- 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
[jira] [Commented] (LOG4J2-774) NdcPatternConverter breaks Log4j 1.2.x layout
[ https://issues.apache.org/jira/browse/LOG4J2-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14095699#comment-14095699 ] Ralph Goers commented on LOG4J2-774: My opinion is that it should be configurable. I have no real preference as to what is the default as I have yet to find a use case where I prefer the thread context stack over the thread context map. NdcPatternConverter breaks Log4j 1.2.x layout - Key: LOG4J2-774 URL: https://issues.apache.org/jira/browse/LOG4J2-774 Project: Log4j 2 Issue Type: Bug Components: Layouts Affects Versions: 2.0.1 Reporter: Frank Wißmann Assignee: Remko Popma Priority: Minor Labels: patch Fix For: 2.0.2 Attachments: NdcPatternConverter.java.patch In Log4j 1.2.17 NdcPatternConverter.format() returns an empty string or the stack messages separated by space a b c (NDC.DiagnosticContext.fullMessage). The PatternLayout \[%20.20x\] results in {code}[]{code} or {code}[ a b c]{code}. In Log4j 2.0.1 NdcPatternConverter.format() returns an unmodified Collection.toString() representation: \[\] for an empty collection or the collection separated by comma \[a, b, c\] (DefaultThreadContextStack.toString() and MutableThreadContextStack.toString()). The PatternLayout \[%20.20x\] results in {code}[ []]{code} or {code}[ [a, b, c]]{code}. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Commented] (LOG4J2-774) NdcPatternConverter breaks Log4j 1.2.x layout
[ https://issues.apache.org/jira/browse/LOG4J2-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14095818#comment-14095818 ] Gary Gregory commented on LOG4J2-774: - I think we should leave the default as it is or improve it such that it becomes machine parsable more easily. A blank separated list of values does not account for embedded blanks and current format has it machine parsable issues as well I am sure. I have not looked in detail in a while. I would support and document some configuration option that is 1.2 compatible since we have a request for it. I would not hold up 2.0.2 for this though, it can go in 2.0.2, or 2.1 IMO. NdcPatternConverter breaks Log4j 1.2.x layout - Key: LOG4J2-774 URL: https://issues.apache.org/jira/browse/LOG4J2-774 Project: Log4j 2 Issue Type: Bug Components: Layouts Affects Versions: 2.0.1 Reporter: Frank Wißmann Assignee: Remko Popma Priority: Minor Labels: patch Fix For: 2.0.2 Attachments: NdcPatternConverter.java.patch In Log4j 1.2.17 NdcPatternConverter.format() returns an empty string or the stack messages separated by space a b c (NDC.DiagnosticContext.fullMessage). The PatternLayout \[%20.20x\] results in {code}[]{code} or {code}[ a b c]{code}. In Log4j 2.0.1 NdcPatternConverter.format() returns an unmodified Collection.toString() representation: \[\] for an empty collection or the collection separated by comma \[a, b, c\] (DefaultThreadContextStack.toString() and MutableThreadContextStack.toString()). The PatternLayout \[%20.20x\] results in {code}[ []]{code} or {code}[ [a, b, c]]{code}. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Commented] (LOG4J2-774) NdcPatternConverter breaks Log4j 1.2.x layout
[ https://issues.apache.org/jira/browse/LOG4J2-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14096367#comment-14096367 ] Remko Popma commented on LOG4J2-774: I think we should follow the principle of least surprise and follow what log4j-1.2, log4net and log4perl do as the default. The PatternLayout is not designed to be machine-parsable and no format will prevent values from containing separator characters. The solution for that is to use XMLLayout or some other format designed to be machine parsable. (An alternative is to use a fixed width, like Frank's original example, in which case any format is equally parsable.) Making this configurable feels a bit overkill, but if people really want multiple formats then of course I don't object. However, it is not high on my list of priorities and I won't have time to work on this for a while. If anyone wants to work on this, how about these format specifiers? * %x\{plain\}: Outputs space-separated stack elements without enclosing brackets. * %x\{list\}: Outputs stack elements in enclosed in [AbstractCollection.toString()|http://docs.oracle.com/javase/7/docs/api/java/util/AbstractCollection.html#toString%28%29] format: enclosed in square brackets with the elements separated by comma+space. (%x\{list\} is shorter and more intuitive to me than %x\{collection\}.) NdcPatternConverter breaks Log4j 1.2.x layout - Key: LOG4J2-774 URL: https://issues.apache.org/jira/browse/LOG4J2-774 Project: Log4j 2 Issue Type: Bug Components: Layouts Affects Versions: 2.0.1 Reporter: Frank Wißmann Priority: Minor Labels: patch Fix For: 2.0.2 Attachments: NdcPatternConverter.java.patch In Log4j 1.2.17 NdcPatternConverter.format() returns an empty string or the stack messages separated by space a b c (NDC.DiagnosticContext.fullMessage). The PatternLayout \[%20.20x\] results in {code}[]{code} or {code}[ a b c]{code}. In Log4j 2.0.1 NdcPatternConverter.format() returns an unmodified Collection.toString() representation: \[\] for an empty collection or the collection separated by comma \[a, b, c\] (DefaultThreadContextStack.toString() and MutableThreadContextStack.toString()). The PatternLayout \[%20.20x\] results in {code}[ []]{code} or {code}[ [a, b, c]]{code}. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org