Skip Menu |

This queue is for tickets about the Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 26310
Status: resolved
Priority: 0/
Queue: Log-Log4perl

People
Owner: MSCHILLI [...] cpan.org
Requestors: LGODDARD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.09
Fixed in: (no value)



Subject: Newline in left-justified for sprintf...
Newline in left-justified string for sprintf Please please please can there be a universal configuration option to do something about this springf warning? Maybe one conf opt ot reformat the single message into multiple, maybe one to just striop the newlines... I know these things can be done with custom this-and-thats, but it seems pretty fundemental to me... Thanks for reading, at least! Lee
Not sure how you would run into that warning, what does your Log4perl configuration look like?
Subject: RE: [rt.cpan.org #26310] Newline in left-justified for sprintf...
Date: Mon, 16 Apr 2007 08:50:41 +0100
To: <bug-Log-Log4perl [...] rt.cpan.org>
From: "Lee Goddard" <LGoddard [...] UK.Advertising.com>
Show quoted text
> From: Michael_Schilli via RT [mailto:bug-Log-Log4perl@rt.cpan.org] > Sent: 13 April 2007 16:48 > To: LGODDARD@cpan.org > Subject: [rt.cpan.org #26310] Newline in left-justified for sprintf...
Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=26310 > > > Not sure how you would run into that warning, what does your Log4perl > configuration look like?
Thanksf or the quick reply. my $conf = ' log4perl.rootLogger = DEBUG, Logfile, Screen log4perl.appender.Logfile = Log::Log4perl::Appender::File log4perl.appender.Logfile.filename = '.$SERVER_LOG_PATH.' log4perl.appender.Logfile.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.Logfile.layout.ConversionPattern = %X{ip} | %-55m | %F{3} %M %L%n log4perl.appender.Screen = Log::Log4perl::Appender::Screen log4perl.appender.Screen.stderr = 1 log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.Screen.layout.ConversionPattern = %X{ip} | %-55m | %F{3} %M %L%n '; Lee Goddard
Subject: RE: [rt.cpan.org #26310] Newline in left-justified for sprintf...
Date: Mon, 16 Apr 2007 22:47:05 -0700 (PDT)
To: Lee Goddard via RT <bug-Log-Log4perl [...] rt.cpan.org>
From: Mike Schilli <m [...] perlmeister.com>
On Mon, 16 Apr 2007, Lee Goddard via RT wrote: Show quoted text
> log4perl.appender.Logfile.layout.ConversionPattern = > %X{ip} | %-55m | %F{3} %M %L%n
Interesting. The formatter "%-55m" prints strings like "abc" as "abc [51 spaces]". Not sure I understand why you want to do that, but it's a free country :). If you have a newline in there, however, perl will complain about it, because it makes little sense to format a multi-line string this way. How would you like a multi-line string (say: "a\nb\nc") to be formatted? By the way, with the next Log4perl release, there'a going to be a multiline layout, which will split message strings like "a\nb\nc" into subsequent renderings like 2007/04/16 22:45:09 a 2007/04/16 22:45:09 b 2007/04/16 22:45:09 c if you have a layout like "%d %m%n". Would that be of any help? -- Mike Mike Schilli m@perlmeister.com
CC: <bug-Log-Log4perl [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #26310] Newline in left-justified for sprintf...
Date: Tue, 17 Apr 2007 11:08:35 +0100
To: <u3 [...] leegoddard.net>
From: "Lee Goddard" <LGoddard [...] UK.Advertising.com>
Mike Schilli via RT wrote: <URL: http://rt.cpan.org/Ticket/Display.html?id=26310 > On Mon, 16 Apr 2007, Lee Goddard via RT wrote: log4perl.appender.Logfile.layout.ConversionPattern = %X{ip} | %-55m | %F{3} %M %L%n Interesting. The formatter "%-55m" prints strings like "abc" as "abc [51 spaces]". Not sure I understand why you want to do that, but it's a free country :). Well...I'm in the UK... ;-) Spending all day, everyday looking a log output has led me to conclude that nicely ordered columns are a good thing, so I've a column of request IDs, then messages, then callers. I'm sure I come up with a better system every month. If you have a newline in there, however, perl will complain about it, because it makes little sense to format a multi-line string this way. How would you like a multi-line string (say: "a\nb\nc") to be formatted? By the way, with the next Log4perl release, there'a going to be a multiline layout, which will split message strings like "a\nb\nc" into subsequent renderings like 2007/04/16 22:45:09 a 2007/04/16 22:45:09 b 2007/04/16 22:45:09 c if you have a layout like "%d %m%n". Would that be of any help? I would be a great help! I was thinking, maybe, though, it might be an option to have output like this: 2007/04/16 22:45:09 a b c A bit easier on the eye, but not something i'd argue about :-) Many thanks for your quick attention, much appreciated, as is all the work on Log4Perl. Thanks! lee
From: LGODDARD [...] cpan.org
Show quoted text
> 2007/04/16 22:45:09 a > 2007/04/16 22:45:09 b > 2007/04/16 22:45:09 c
Seems to have lost whitespace in transition to RT. So, s/\./ /sg: 2007/04/16.2:45:09.a ...................b ...................c Thanks, Lee
Thanks, you resolved this by introducing the multiline pattern layout module.