[rt-users] Timestamp logging

Marc Beyer marc.beyer at digitalbridges.com
Thu May 9 06:43:08 EDT 2002


And the 's' it was. Thanks a bunch, Jesse!

Marc

On Thu, 2002-05-09 at 11:29, Jesse Vincent wrote:
> The following change to the logging behaviour is already targetted for 
> 2.0.14:
> 
> callbacks => sub {my %p=@_; return "[".gmtime(time)."] [".$p{level}.  "]: $p{message}\n"}
> 
> 
> Note especially the critical 's' on callbacks.
> 
> 
> 	-j
> 
> On Thu, May 09, 2002 at 11:11:36AM +0100, Marc Beyer wrote:
> > Hi,
> > 
> > how do I put a timestamp before each logging entry? I've tried adding it
> > to the callback subroutine in RT.pm like so:
> > 
> >   $Logger->add(Log::Dispatch::File->new
> > 	( name=>'rtlog',
> > 	 min_level=> $RT::LogToFile,
> > 	 filename=> $filename,
> > 	 mode=>'append',
> > 	 callback => sub {my %p=@_; return sub {($_[0],$_[1],$_[2], $_[5]+1900,
> > $_[4]+1, $_[3])}->(localtime).": $p{message}\n"} ));
> > 
> > But that doesn't do anything to the logging output. In fact, modifying
> > this parameter (forex removing the $p{message} ) doesn't seem to affect
> > the logging output at all. This is using RT 2.0.11
> > 
> > Thanks in advance for any help,
> > 
> > Marc
> > 
> > 
> > 
> > 
> > ________________________________________________________________________
> > 
> > E-mail is an informal method of communication and may be subject to data corruption, interception and unauthorised amendment for which Digital Bridges Ltd will accept no liability. Therefore, it will normally be inappropriate to rely on information contained on e-mail without obtaining written confirmation.
> > 
> > This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
> > 
> > ________________________________________________________________________
> > 
> > 
> > _______________________________________________
> > rt-users mailing list
> > rt-users at lists.fsck.com
> > http://lists.fsck.com/mailman/listinfo/rt-users
> > 
> > Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
> > 
> 
> -- 
> http://www.bestpractical.com/products/rt  -- Trouble Ticketing. Free.
> 
> _______________________________________________
> rt-users mailing list
> rt-users at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-users
> 
> Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm



________________________________________________________________________

E-mail is an informal method of communication and may be subject to data corruption, interception and unauthorised amendment for which Digital Bridges Ltd will accept no liability. Therefore, it will normally be inappropriate to rely on information contained on e-mail without obtaining written confirmation.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

________________________________________________________________________





More information about the rt-users mailing list