Job Output Retrieval System
SQL Agent is a Windows service used to retrieve the output (stdout/stderr along with some additional information) generated by each job running through the agent. This output is helpful in identifying any runtime errors that might have occurred while the jobs are running.
The SQL Agent service communicates on a specific port number configured in SQLAgent.ini JORSSocket setting under the JORS Settings section. This value must match the JORS Port Number configured in Advanced Machines Configuration - Communication Settings.
JORS captures the following information for each job:
- Internal Job Name
- STDOUT generated
- STDERR generated
- Job Start/End Time
- Job Process Name and PID
- Job ExitCode
The agent creates one log file for each job with all the above information pertinent to that job. The job log file is created under the JobOutput folder when job is running and eventually saved under the <Output Directory>\SQLAgent\JobOutput\Archives\<Job schedule Date> folder when job completes.
The Output Directory was configured during the installation. For more information, refer to File Locations in the Concepts online help.
The archived JobOutput folders also get cleaned up based on ArchiveDaysToKeep setting configured under Debug Options. Any output logs older than ArchiveDaysToKeep get cleaned up at midnight.