10-06-2008 10:30 AM
Hello! I have a script to pull information from UT database. my cron-job log file showing the error the very common log4j. my question is not about log4j. but I would like added a time stamp on my log. I know all CiscoWorks log has times stamp. but my log doesn't have. any body can solve the same problem how to added a time stamp on perl script to know when exactly the error occur.
10-06-2008 10:35 AM
print LOG scalar localtime, ': ', $msg, "\n";
10-06-2008 11:26 AM
thank you so much J. this line can be added on any line of my script? or at the end or at beginning?and either a space between ,':', or all flat!! once again thank you!!
10-06-2008 12:21 PM
This line prints out the value of the variables $msg preceded by the current timestamp. You would use this line to log a line to your script's logfile. It assumes the logfile handle is called LOG.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: