From: Harrington, P. <Pau...@de...> - 2002-11-07 16:02:28
|
Here is the full patch .... put in the extra (but not necessary?) step of assigning to $result just to highlight it. I don't know how you guys feel about 'feeping creaturism' with tokens but we would also like a token, say %h or %H, for the hostname ... we use are using a centralized file for our logs so would like the hostname too. pjjH --- PatternLayout.pm Mon Oct 7 17:41:50 2002 +++ /proj/finop/local_boffice/lib/perl5/site_perl/5.6.1/Log/Log4perl/Layout/Patt ernLayout.pm Wed Nov 6 14:47:25 2002 @@ -90,7 +90,7 @@ # Parse the format $format =~ s/%(-*\d*) - ([cCdfFILmMnprtxX%]) + ([cCdfFILmMnpPrtxX%]) (?:{(.*?)})*/ rep($self, $1, $2, $3); /gex; @@ -171,6 +171,7 @@ $info{d} = 1; # Dummy value, corrected later $info{n} = "\n"; $info{p} = $priority; + $info{P} = $$; if($self->{info_needed}->{r}) { if($TIME_HIRES_AVAILABLE) { @@ -201,6 +202,9 @@ # just for %d if($op eq 'd') { $result = $info{$op}->format(current_time()); + } + if($op eq 'P') { + $result = $$; } } push @results, $result; -----Original Message----- From: msc...@ao... [mailto:msc...@ao...] Sent: Thursday, November 07, 2002 5:49 AM To: Harrington, Paul; log...@li... Subject: Re: [log4perl-devel] Could we have a token in PatternLayout for pid In a message dated 11/6/2002 6:26:36 PM Eastern Standard Time, Pau...@de... writes: >we hacked in support today for a %P token so that we can include process ids >in the log messages without mucking around with the application-level log >messages. Accepted and checked in -- it's going to be part of 0.26, thanks! -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |