cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
462
Views
0
Helpful
3
Replies

user tracking

eliaspaulos
Level 1
Level 1

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.

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

print LOG scalar localtime, ': ', $msg, "\n";

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!!

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.

Getting Started

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: