saving.adoc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. [#save-logs]
  2. = Saving logs
  3. 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.
  4. You can configure the global setting for saving logs, or override it on a per-action basis;
  5. [source,yaml]
  6. .`config.yaml`
  7. ----
  8. saveLogs:
  9. resultsDirectory: /var/log/OliveTin/results/
  10. outputDirectory: /var/log/OliveTin/output/
  11. actions:
  12. # This will use the default `saveLogs` setting.
  13. - title: date
  14. shell: date
  15. # This will override the default `saveLogs` setting.
  16. - title: date2
  17. shell: date
  18. saveLogs:
  19. resultsDirectory: /logs/
  20. outputDirectory: /logs/
  21. ----
  22. From the above example, you can see there There are two types of logs - **results (.yaml)** and **output (.log)**
  23. 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.
  24. * **Results (.yaml)** - this captures almost everything that OliveTin knows about the action and looks like this.
  25. +
  26. [source,yaml]
  27. .Example results - date.1714333384.5e2dc9e5-b6b3-445b-bff9-c2082b0bbbb2.yaml
  28. ----
  29. datetimestarted: 2024-04-28T20:43:04.426754136+01:00
  30. datetimefinished: 2024-04-28T20:43:04.436596926+01:00
  31. stdout: |
  32. Sun 28 Apr 20:43:04 BST 2024
  33. stderr: ""
  34. timedout: false
  35. blocked: false
  36. exitcode: 0
  37. tags: []
  38. executionstarted: true
  39. executionfinished: true
  40. executiontrackingid: 5e2dc9e5-b6b3-445b-bff9-c2082b0bbbb2
  41. process:
  42. pid: 4168638
  43. actiontitle: date
  44. actionicon: '😀'
  45. actionid: d3cf6e25-8bab-432d-b4f9-e6f531b2b67b
  46. ----
  47. * **output (.log)** - this just captures the output - stdout, stderr from an execution,
  48. +
  49. [source]
  50. .Example output - date.1714333384.5e2dc9e5-b6b3-445b-bff9-c2082b0bbbb2.log
  51. ----
  52. Sun 28 Apr 20:43:04 BST 2024
  53. ----