[#save-logs]
= 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.

You can configure the global setting for saving logs, or override it on a per-action basis;

[source,yaml]
.`config.yaml`
----
saveLogs:
    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)**

* **Results (.yaml)** - this captures almost everything that OliveTin knows about the action and looks like this.
+
[source,yaml]
.Example results - date.1714333384.5e2dc9e5-b6b3-445b-bff9-c2082b0bbbb2.yaml
----
datetimestarted: 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: '&#x1F600;'
actionid: d3cf6e25-8bab-432d-b4f9-e6f531b2b67b
----

* **output (.log)** - this just captures the output - stdout, stderr from an execution,
+
[source]
.Example output - date.1714333384.5e2dc9e5-b6b3-445b-bff9-c2082b0bbbb2.log
----
Sun 28 Apr 20:43:04 BST 2024
----


