Where to find Job Log for a Scheduled Job that Ran?

Wendy Peterson
Giga Guru

I have a scheduled job that is a Job Type of Scheduled Data Extract. It's never making it to our FTP Server. Does anyone know if there is a job log i can look at somewhere to tell if it actually ran or how i can tell if there is some kind of error somewhere? It's been in place since we went live 6 years ago. I believe it was code that Crossfuze did way back when that was a free download the consultant company used. It's always just worked so I've never given it much thought.

Thanks

2017-02-02_15-58-04.jpg

1 ACCEPTED SOLUTION

Dave Smith1
ServiceNow Employee
ServiceNow Employee

Logs can be found at System Logs > All.  



Given the scheduled job is a script, you should be able to filter for script logging actions to see what it's written - best practise suggests that scripts should log what they're doing.  


View solution in original post

8 REPLIES 8

That would have been my approach.



Although the job was written for technology for its time, a lot can change in 6 years; reengineering it (and adding some proper documentation) is more work but takes advantage of modern methods, including learned best practise and more optimal technology.



On the surface, a lot of people won't really care much about the implementation details, just that the end result fits the purpose: it performs the task it needs to do. However, using modern approaches may certainly make the overall task quicker with less resource demands - so perhaps it was due a rewrite anyway.



Good luck, and let us know if we can help out in any other way.


ytrottier
Tera Contributor

Actually, oddly enough, it seems there is no place where the output of a scheduled job is saved.

That would be quite helpful to have to audit and debug scheduled jobs.

However, a scheduled job is also a transaction in SN : a transaction where the URL starts with JOB: (followed by the scheduled job name).

So, if you look in the SN menu, under System Logs -> Transactions (Background), one would think you would find execution statistics about all executed jobs.  But unfortunately, that is not the case.  It is actually the same view as the one available under System Scheduler -> Scheduled Jobs -> Slow Job Log.  Only scheduled jobs that have an execution time of more than 1 second are shown in those views.

In the end, the sys_trigger table (System Scheduler -> Scheduled Jobs -> Scheduled Jobs) is where you have a record of each scheduled job execution.  And adding the Process duration, Run count, Updated and Updated by fields to the sys_trigger table list and form will allow you to have a complete picture of the last job(s) execution.

Note : All this is somewhat confusing and should not to be confused with the scheduled jobs definition, which are found in the sysauto table, under System Definition -> Scheduled Jobs.

I mention it because that is exactly what I did initially : manually creating a scheduled job instance under System Scheduler -> Scheduled Jobs -> Scheduled Jobs, thinking it was where the scheduled jobs were defined, instead of using System Definition -> Scheduled Jobs.

Glad that I wasn't the only one to have System Scheduler -> Scheduled Jobs -> Scheduled Jobs confused with System Definition -> Scheduled Jobs

Daniel Oderbolz
Kilo Sage

Dear Wendy

A good place to look is the syslog_transaction table.

It shows which jobs ran when and how much data was processed.

Best
Daniel


If this answer was helpful, I would appreciate if you marked it as such - thanks!

Best
Daniel