Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 43A60200C30 for ; Tue, 7 Mar 2017 17:38:43 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 42315160B68; Tue, 7 Mar 2017 16:38:43 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8BF28160B65 for ; Tue, 7 Mar 2017 17:38:42 +0100 (CET) Received: (qmail 23233 invoked by uid 500); 7 Mar 2017 16:38:41 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 23224 invoked by uid 99); 7 Mar 2017 16:38:41 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Mar 2017 16:38:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 39B241A0666 for ; Tue, 7 Mar 2017 16:38:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.452 X-Spam-Level: * X-Spam-Status: No, score=1.452 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 2g7MrwwKQpuZ for ; Tue, 7 Mar 2017 16:38:40 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id ECDE360E08 for ; Tue, 7 Mar 2017 16:38:39 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CA02DE09D6 for ; Tue, 7 Mar 2017 16:38:38 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5791C24182 for ; Tue, 7 Mar 2017 16:38:38 +0000 (UTC) Date: Tue, 7 Mar 2017 16:38:38 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4J2-1838) Add support for appending common suffix to each line of throwable stack trace MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 07 Mar 2017 16:38:43 -0000 [ https://issues.apache.org/jira/browse/LOG4J2-1838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15899729#comment-15899729 ] ASF GitHub Bot commented on LOG4J2-1838: ---------------------------------------- Github user jvz commented on the issue: https://github.com/apache/logging-log4j2/pull/61 That's a pretty good point! I should have time later today to merge this unless someone else swoops in during the day to do it. Thanks for the contribution! > Add support for appending common suffix to each line of throwable stack trace > ----------------------------------------------------------------------------- > > Key: LOG4J2-1838 > URL: https://issues.apache.org/jira/browse/LOG4J2-1838 > Project: Log4j 2 > Issue Type: New Feature > Components: Pattern Converters > Affects Versions: 2.8.1 > Reporter: Zilong Song > Labels: features > Fix For: 2.8.2 > > > Add support for appending common suffix to each line of throwable stack trace. The suffix can be configured by patterns just like patterns used elsewhere. > For example, pattern {{%xEx{suffix(- %mdc{key})}}} will append a string generated by pattern {{- }} and {{%mdc{key}}}. > But patterns that handles throwable will be automatically ignored, because they will make the rendered result confusing. So pattern {{%xEx{suffix(- %rEx%mdc{key})}}} has the same effect with {{%xEx{suffix(- %mdc{key})}}}, as if the nested {{%rEx}} pattern has never appeared. > Following is an example of the with such suffix: > {code:title=stack trace, with pattern "%xEx{suffix(- %mdc{key})}" and MDC(key)="test mdc suffix"|borderStyle=solid} > java.lang.IllegalArgumentException: IllegalArgument - test mdc suffix > at org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverterTest.testSuffixFromNormalPattern(ExtendedThrowablePatternConverterTest.java:48) [test-classes/:?] - test mdc suffix > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] - test mdc suffix > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] - test mdc suffix > at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] - test mdc suffix > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:?] - test mdc suffix > Caused by: java.lang.NullPointerException: null pointer - test mdc suffix > at org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverterTest.testSuffixFromNormalPattern(ExtendedThrowablePatternConverterTest.java:47) ~[test-classes/:?] - test mdc suffix > ... 27 more - test mdc suffix > }} > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org