Frustrated by the inadequate tools available for this, I created a little workflow (along with related objects) that facilitates collection of rolling traces in the Automation Engine.
The workflow has two main modes of operation:
- Disable tracing: Run the workflow without changing any of the prompt set values (just leave them set to their defaults), and it will disable tracing completely.
- Enable tracing: Select something other than 0=Trace disabled from the AE Processes menu, and select something other than 0=no output from one or more of the Trace options menus, and the workflow will activate tracing according to the options you selected.
The script uses
:SET_UC_SETTING to enable tracing initially, but uses
CHANGE_LOGGING to begin writing new files. You can specify an interval between writing subsequent files, a maximum duration, and a maximum number of times to begin writing new files. The workflow disables tracing when the maximum duration has been reached, or the maximum number of files has been written, whichever comes first.
The workflow also includes a couple of extra safety mechanisms:
- It checks whether the target file system has enough free space; if the amount of free space goes below this limit (default: 15%), tracing is disabled.
- It turns off tracing if the trace options have been changed, either manually or by another task. So if you run another instance of the workflow to disable tracing (or simply disable tracing manually), any currently running instances of the workflow will detect the change and quit (upon completion of their currently-running
:WAIT interval — see below).
These checks are performed every two minutes.
To use the workflow in your environment, you will need to adjust a few things:
1. Set the queue of the workflow and script to a queue that exists in your system.
2. Adjust these variables in the process tab of the workflow:
:PSET &Trace_Filesystem# = "/var"
:PSET &AE_Agent_or_AgentGroup# = "AE_SERVERS"
:PSET &AE_Agent_Login# = "UC4.LOGIN"
:PSET &Queue# = "UC4"
:PSET &MinFilesystemFreePercent# = "15"
Update 2018.01.31 16:45 CET: I updated the workflow so that it performs the periodic checks at two minute intervals, regardless how often new log/trace files are written. To change the check interval, change this line in the script:
:SET &CheckInterval# = 120
I recommend keeping this interval between 30 seconds and 5 minutes.
This workflow builds on some things I have shared here before: