Return-Path: X-Original-To: apmail-logging-log4j-user-archive@www.apache.org Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8862018DDF for ; Tue, 19 Apr 2016 15:00:59 +0000 (UTC) Received: (qmail 43903 invoked by uid 500); 19 Apr 2016 15:00:59 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 43849 invoked by uid 500); 19 Apr 2016 15:00:59 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 43838 invoked by uid 99); 19 Apr 2016 15:00:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Apr 2016 15:00:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B8C2BC27DA for ; Tue, 19 Apr 2016 15:00:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id MXrrLifKJD3n for ; Tue, 19 Apr 2016 15:00:56 +0000 (UTC) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 47AD05FACF for ; Tue, 19 Apr 2016 15:00:56 +0000 (UTC) Received: by mail-ob0-f180.google.com with SMTP id n10so14095567obb.2 for ; Tue, 19 Apr 2016 08:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=/MY64zTXBYVYFm6VNiBXdm36NZW3ykib7ryFPWSWITI=; b=vBv/uB/2//Pe4VejNceDGl0NLBCPQHhcVu9R2+HrDFYBja5IHJE9QcgQQx995oYoWE OkCxDFjmNVp8XyqT03DQPoGrKZXPrhBMjTFjOPUVhfuGxawZNDOuICT9zWj/Hfv8aVqY JRiDsEIMP3DObx9+Qwe8xuH+upcbuV8Z3U9eni7wNkQI/2/6/EwetZWYmGOo7dPBrN1H r26GvFecuSWFOgKnRBy8GIpzWD/l+SbpeeJ9JkX8sQixJ3uINwGYGdpaATVIT4EixH+0 fFCGovf99wgHTnPbQig2JmbLzg5LmTR95cpIwM0u24BkV9+FME1ix6WW7mUCmNaSHPD5 HZaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=/MY64zTXBYVYFm6VNiBXdm36NZW3ykib7ryFPWSWITI=; b=egA8WwP43eN1U2rcWvnKgl7SGMwwdf2PatWqPL1xdM3r3Ai271UK5aqJqUZAB3H5m0 xYh15hupsN/1BQmkpmUBR3E0Xlukjr8LzappJr4JoDkykTVq40jcES5qt6GPeBVKNsQZ +TVqEZeDAVHC/6DJOOMNojWnyupti2+K3rY5i/CsGWBF7eSwWmg3+Wn8dScCTVm/KbkK XkVD9Ay49MfJyVn8jSlA+EVHHhgWY8r3h85A5XBfSb6AGm5mwIObuey1r4k7f9nwkLPv RQmtNmvS6qhm5c7zKCU5Jks90LdRlgTDeuT44pIknqIptRC6fc9Bhb8iQKcCRV6NIbxp HNCQ== X-Gm-Message-State: AOPr4FV0s4zfd8IHKS8u41XaXvlr6q778Df0nEqAIvaRgr7KF50SE3sce5owcUTqApzhCC2bIejtwp314e//dQ== MIME-Version: 1.0 X-Received: by 10.182.10.38 with SMTP id f6mr1374030obb.17.1461078055473; Tue, 19 Apr 2016 08:00:55 -0700 (PDT) Received: by 10.157.43.58 with HTTP; Tue, 19 Apr 2016 08:00:55 -0700 (PDT) In-Reply-To: References: <5A29087B-DBBC-44A0-9C5C-6B747AD69BEE@dslextreme.com> Date: Tue, 19 Apr 2016 08:00:55 -0700 Message-ID: Subject: Re: XMLLayout indents, but not the first child tag () From: Gary Gregory To: Log4J Users List Content-Type: multipart/alternative; boundary=f46d044795f77c59d40530d7bedc --f46d044795f77c59d40530d7bedc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Does the build pass when you run 'mvn clean test'? Does your patch affect the other Jackson-based layouts (JSON and YAML)? Hopefully not. I think that if all the tests pass and the other layouts are not affected, you should create a JIRA and attach your patch. Even if not, you can still create a JIRA and attach a WIP patch. BTW, make sure your patch has unit tests so we can make sure this change works and does not get undone in the future. Gary On Tue, Apr 19, 2016 at 7:24 AM, Kamal Mettananda wrote: > Hi Gary > > Not really, the number of blank lines are exactly the same in both cases, > but the new one has the indentation also fixed. Please see below summariz= ed > version of the two files (both having two *BLANK LINE*s, but it's locatio= n > is different). > > *Current Xml file* > > > > > *BLANK LINE* > > *BLANK LINE* > > > *New Xml file* > > > > *BLANK LINE* > > *BLANK LINE* > > > > However if this does not still fit, still please let me know. > > If it sounds OK, I can create the Jira with patch so that the team can lo= ok > into and decide whether to proceed with it or not. > > Thanks > > ----------------- > www.digizol.com > > On Tue, Apr 19, 2016 at 2:58 AM Gary Gregory > wrote: > > > Hi, yes they way to go is to create a JIRA and then _attach_ your patch > in > > united diff format to the JIRA issue. > > > > There is more blank lines with this right? That's not great but submit > your > > patch and let's see what happens. > > > > Gary > > > > On Mon, Apr 18, 2016 at 10:55 AM, Kamal Mettananda > > wrote: > > > > > Hi all > > > > > > Already there is one blank line between any two blocks within > the > > > XML file; but that is because of the way the existing PrettyPrinter > class > > > behaves. However I too feel it is not good to have multiple blank lin= es > > > between blocks. > > > > > > I did a slight change to the way the PrettyPrinter works; and got the > XML > > > printed as follows (only with one blank line between any two > > blocks > > > - most similar to current output). > > > > > > *Current Xml file* > > > > > > > > > > > timeMillis=3D"1460974404123" thread=3D"main" level=3D"INFO" > > > loggerName=3D"com.foo.Bar" endOfBatch=3D"true" > > > loggerFqcn=3D"org.apache.logging.log4j.spi.AbstractLogger" threadId= =3D"11" > > > threadPriority=3D"5"> > > > Message flushed with immediate flush=3Dfalse > > > > > > > > > > > timeMillis=3D"1460974404133" thread=3D"main" level=3D"INFO" > > > loggerName=3D"com.foo.Bar" endOfBatch=3D"true" > > > loggerFqcn=3D"org.apache.logging.log4j.spi.AbstractLogger" threadId= =3D"11" > > > threadPriority=3D"5"> > > > Message flushed with immediate flush=3Dfalse > > > > > > > > > > > > > > > *New Xml file* > > > ^M > > > > > > > > > > > timeMillis=3D"1460973958301" thread=3D"main" level=3D"INFO" > > > loggerName=3D"com.foo.Bar" endOfBatch=3D"true" > > > loggerFqcn=3D"org.apache.logging.log4j.spi.AbstractLogger" threadId= =3D"11" > > > threadPriority=3D"5"> > > > Message flushed with immediate flush=3Dfalse > > > > > > > > > > > timeMillis=3D"1460973958323" thread=3D"main" level=3D"INFO" > > > loggerName=3D"com.foo.Bar" endOfBatch=3D"true" > > > loggerFqcn=3D"org.apache.logging.log4j.spi.AbstractLogger" threadId= =3D"11" > > > threadPriority=3D"5"> > > > Message flushed with immediate flush=3Dfalse > > > > > > > > > > > > Please have a look at that and let me know whether this seems OK. If > that > > > seems correct, I can update the test cases as well and share a patch. > > > > > > As I am new here, please let me know whether I should create a Jira > > ticket > > > and attach the patch > or > > > attach it into an email? > > > > > > Thanks > > > > > > ------------------ > > > www.digizol.com > > > > > > > > > On Mon, Apr 18, 2016 at 3:36 AM Ralph Goers < > ralph.goers@dslextreme.com> > > > wrote: > > > > > > > I certainly wouldn=E2=80=99t expect to see any blank lines. > > > > > > > > Ralph > > > > > > > > > On Apr 17, 2016, at 2:42 PM, Gary Gregory > > > > wrote: > > > > > > > > > > IMO there should not be any blank lines, even in non-compact mode= . > > > > > > > > > > Thoughts from others? > > > > > Gary > > > > > On Apr 17, 2016 1:34 PM, "Kamal Mettananda" > > wrote: > > > > > > > > > >> Hi Gary & all > > > > >> > > > > >> I looked at the code and did some modifications around the > > > > >> jackson-dataformat-xml based formatting area. As per current > > > > >> implementation, there is one additional line between each ending > > > > > > > > >> tag and next new tag; but with this fix, there will be > > another > > > > >> additional new line between those as shown below. > > > > >> > > > > >> I am not sure whether that is OK, so please let me know your > > thoughts > > > on > > > > >> this result. > > > > >> > > > > >> *Current XML file* > > > > >> ^M > > > > >> > > > > >> > > > >> timeMillis=3D"1460924567162" thread=3D"main" level=3D"INFO" > > > > >> loggerName=3D"com.foo.Bar" endOfBatch=3D"true" > > > > >> loggerFqcn=3D"org.apache.logging.log4j.spi.AbstractLogger" > > threadId=3D"11" > > > > >> threadPriority=3D"5"> > > > > >> Message flushed with immediate flush=3Dfalse > > > > >> > > > > >> > > > > >> > > > >> timeMillis=3D"1460924567162" thread=3D"main" level=3D"INFO" > > > > >> loggerName=3D"com.foo.Bar" endOfBatch=3D"true" > > > > >> loggerFqcn=3D"org.apache.logging.log4j.spi.AbstractLogger" > > threadId=3D"11" > > > > >> threadPriority=3D"5"> > > > > >> Message flushed with immediate flush=3Dfalse > > > > >> > > > > >> > > > > >> > > > > >> > > > > >> *New XML file* > > > > >> > > > > >> > > > > >> > > > > >> > > > > >> > > > >> timeMillis=3D"1460924457009" thread=3D"main" level=3D"INFO" > > > > >> loggerName=3D"com.foo.Bar" endOfBatch=3D"false" > > > > >> loggerFqcn=3D"org.apache.logging.log4j.spi.AbstractLogger" > > threadId=3D"11" > > > > >> threadPriority=3D"5"> > > > > >> Message flushed with immediate flush=3Dfalse > > > > >> > > > > >> > > > > >> > > > > >> > > > >> timeMillis=3D"1460924457010" thread=3D"main" level=3D"INFO" > > > > >> loggerName=3D"com.foo.Bar" endOfBatch=3D"true" > > > > >> loggerFqcn=3D"org.apache.logging.log4j.spi.AbstractLogger" > > threadId=3D"11" > > > > >> threadPriority=3D"5"> > > > > >> Message flushed with immediate flush=3Dfalse > > > > >> > > > > >> > > > > >> > > > > >> > > > > >> I can share the code as a patch in case this approach is OK. > > > > >> > > > > >> Thanks > > > > >> > > > > >> --------------------------- > > > > >> www.digizol.com > > > > >> > > > > >> On Mon, Apr 11, 2016 at 11:19 PM Gary Gregory < > > garydgregory@gmail.com > > > > > > > > >> wrote: > > > > >> > > > > >>> Feel free to submit a unit test and patch. > > > > >>> > > > > >>> Gary > > > > >>> > > > > >>> On Mon, Mar 28, 2016 at 12:00 PM, Kamal Mettananda < > > lkamal@gmail.com > > > > > > > > >>> wrote: > > > > >>> > > > > >>>> Hi all > > > > >>>> > > > > >>>> I am using log4j 2.5 to print the logs via XMLLayout. I have s= et > > > > >>>> compact=3D"true", hence the new line and indents of sub tags w= ork > > > > >>> correctly. > > > > >>>> However I have noticed that the first child tag is not indente= d > > > > >>> corrected. > > > > >>>> Following is such a sample where and are at t= he > > > same > > > > >>>> indent level (0 indent). I do think this is a formatting issue > in > > > the > > > > >>> code > > > > >>>> rather than expected behavior; but I might be wrong? > > > > >>>> > > > > >>>> > > > > >>>> > > > > >>>> > > > >>>> timeMillis=3D"1459191034362" thread=3D"main" level=3D"INFO" > > > > >>>> loggerName=3D"org.logging.learn.log4j.Main" endOfBatch=3D"fals= e" > > > > >>>> loggerFqcn=3D"org.apache.logging.log4j.spi.AbstractLogger"> > > > > >>>> 6 + 4 =3D 10 > > > > >>>> > > > > >>>> > > > > >>>> > > > >>>> timeMillis=3D"1459191034457" thread=3D"main" level=3D"INFO" > > > > >>>> loggerName=3D"org.logging.learn.log4j.Main" endOfBatch=3D"fals= e" > > > > >>>> loggerFqcn=3D"org.apache.logging.log4j.spi.AbstractLogger"> > > > > >>>> 6 - 4 =3D 2 > > > > >>>> > > > > >>>> > > > > >>>> > > > > >>>> > > > > >>>> Thanks > > > > >>>> > > > > >>> > > > > >>> > > > > >>> > > > > >>> -- > > > > >>> E-Mail: garydgregory@gmail.com | ggregory@apache.org > > > > >>> Java Persistence with Hibernate, Second Edition > > > > >>> > > > > >>> JUnit in Action, Second Edition < > http://www.manning.com/tahchiev/> > > > > >>> Spring Batch in Action > > > > >>> Blog: http://garygregory.wordpress.com > > > > >>> Home: http://garygregory.com/ > > > > >>> Tweet! http://twitter.com/GaryGregory > > > > >>> > > > > >> > > > > > > > > > > > > > > > > -------------------------------------------------------------------= -- > > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > > > > For additional commands, e-mail: log4j-user-help@logging.apache.org > > > > > > > > > > > > > > > > > > > -- > > E-Mail: garydgregory@gmail.com | ggregory@apache.org > > Java Persistence with Hibernate, Second Edition > > > > JUnit in Action, Second Edition > > Spring Batch in Action > > Blog: http://garygregory.wordpress.com > > Home: http://garygregory.com/ > > Tweet! http://twitter.com/GaryGregory > > > --=20 E-Mail: garydgregory@gmail.com | ggregory@apache.org Java Persistence with Hibernate, Second Edition JUnit in Action, Second Edition Spring Batch in Action Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory --f46d044795f77c59d40530d7bedc--