Saving logs
By default, OliveTin only keeps logs in memory, meaning that if you restart OliveTin your logs will be lost. For some use cases this is acceptable, but you can configure OliveTin to save logs for you.
How many logs are kept in memory
OliveTin keeps up to 2000 execution logs in memory, which is what the Logs pages show. When there are more, the oldest finished logs are removed. Logs for executions that are still running or queued are never removed, and neither are logs that still count towards an action’s rate limit.
You can change the limit with logHistoryLimit (minimum 100):
config.yamllogHistoryLimit: 5000
Logs saved to disk with saveLogs are not removed. When OliveTin starts, it loads the newest saved logs up to the limit.
When saveLogs is enabled, OliveTin writes a file for each configured directory when an execution finishes — a results YAML when resultsDirectory is set, and an output log when outputDirectory is set. If only one directory is configured, only that file type is written. This includes blocked runs (for example when concurrency or rate limits prevent the action from starting).
You can configure the global setting for saving logs, or override it on a per-action basis;
config.yamlsaveLogs:
resultsDirectory: /var/log/OliveTin/results/
outputDirectory: /var/log/OliveTin/output/
actions:
# This will use the default `saveLogs` setting.
- title: date
shell: date
# This will override the default `saveLogs` setting.
- title: date2
shell: date
saveLogs:
resultsDirectory: /logs/
outputDirectory: /logs/
From the above example, you can see there There are two types of logs - results (.yaml) and output (.log)
Filenames are built from the action title, a unix timestamp, and the execution tracking ID. Characters that are unsafe in filenames (for example / and \) are replaced with _ so titles like Create/update Monthly Report still write a single file. The original title is unchanged inside the results YAML.
-
Results (.yaml) - this captures almost everything that OliveTin knows about the action and looks like this.
Example results - date.1714333384.5e2dc9e5-b6b3-445b-bff9-c2082b0bbbb2.yamldatetimestarted: 2024-04-28T20:43:04.426754136+01:00 datetimefinished: 2024-04-28T20:43:04.436596926+01:00 stdout: | Sun 28 Apr 20:43:04 BST 2024 stderr: "" timedout: false blocked: false exitcode: 0 tags: [] executionstarted: true executionfinished: true executiontrackingid: 5e2dc9e5-b6b3-445b-bff9-c2082b0bbbb2 process: pid: 4168638 actiontitle: date actionicon: '😀' actionid: d3cf6e25-8bab-432d-b4f9-e6f531b2b67b -
output (.log) - this just captures the output - stdout, stderr from an execution,
Example output - date.1714333384.5e2dc9e5-b6b3-445b-bff9-c2082b0bbbb2.logSun 28 Apr 20:43:04 BST 2024