Timestamp logging

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.

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.

-jOn 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@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.

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

MarcOn 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@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@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.