[rt-users] Timestamp logging

Marc Beyer marc.beyer at digitalbridges.com
Thu May 9 06:11:36 EDT 2002


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.

________________________________________________________________________





More information about the rt-users mailing list