Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

user tracking

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
Cisco Employee

Re: user tracking

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

New Member

Re: user tracking

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

Cisco Employee

Re: user tracking

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.

92
Views
0
Helpful
3
Replies
CreatePlease to create content