Job Output Retrieval System
What is it?
The Job Output Retrieval System (JORS) is a Windows service that captures the output (stdout/stderr plus job metadata) generated by each job that runs through the SQL Agent. JORS gives operators a way to see what a job actually produced — useful for:
- Diagnosing job failures and runtime errors.
- Confirming that a job did the work it was supposed to do.
- Auditing what a long-running batch produced.
JORS communicates with OpCon over a port configured in SQLAgent.ini. The configured port must match the JORS Port Number in Advanced Machines Configuration → Communication Settings in OpCon. If the values do not match, OpCon cannot retrieve job output even though jobs run normally.
What JORS captures
For each job, JORS captures:
- Internal Job Name
- STDOUT generated by the job
- STDERR generated by the job
- Job Start/End Time
- Job Process Name and PID
- Job ExitCode
How output is stored
The agent creates one log file per job containing all of the captured information.
| Phase | Location |
|---|---|
| While the job is running | <Output Directory>\SQLAgent\JobOutput\ |
| After the job completes | <Output Directory>\SQLAgent\JobOutput\Archives\<Job schedule Date>\ |
The Output Directory was set during installation. For more information, refer to File Locations in the Concepts online help.
The SQL Agent cleans up archived JobOutput folders based on the ArchiveDaysToKeep setting under Debug Options. Logs older than ArchiveDaysToKeep are removed at midnight.
FAQs
Where are job output files stored while a job is running? While the job is running, the output is stored in the JobOutput folder.
Where are job output files moved after a job completes?
Once the job completes, the output is saved under <Output Directory>\SQLAgent\JobOutput\Archives\<Job schedule Date>.
How long are archived job outputs kept? The SQL Agent removes archived JobOutput folders based on the ArchiveDaysToKeep setting under Debug Options. Logs older than ArchiveDaysToKeep are cleaned up at midnight.
Why must the JORSSocket value match an OpCon configuration value? The SQL Agent service communicates with OpCon on the port number set in the SQLAgent.ini JORSSocket setting. This value must match the JORS Port Number configured in Advanced Machines Configuration - Communication Settings, otherwise OpCon cannot reach the agent's JORS service.
Glossary
- STDOUT — Standard output stream. Captures regular output messages produced by a job.
- STDERR — Standard error stream. Captures error messages produced by a job.
- PID — Process Identifier. A number assigned by the operating system to each running process.
- ExitCode — A numeric value returned by a process when it ends, used to indicate success or failure.
Related topics
- SQLAgent.ini file configuration — Configure the JORSSocket and other JORS settings.
- Logging — Agent log files (separate from JORS job output).