logs.adoc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. [#log-levels]
  2. = Logging - Application
  3. [NOTE]
  4. There are two different types of logs in OliveTin - xref:advanced_configuration/logs.adoc[application logs] and xref:advanced_configuration/logs-actions.adoc[action logs]. This page is about the __application logs__, which are the logs that OliveTin itself generates. The action logs are the logs that are generated by the actions that you run in OliveTin.
  5. OliveTin supports a few different log levels. The default logLevel is `INFO`.
  6. You can set a `logLevel` in config.yaml like this;
  7. .`config.yaml`
  8. [source,yaml]
  9. ----
  10. logLevel: "INFO"
  11. actions:
  12. ....
  13. ----
  14. The supported log levels are;
  15. * `DEBUG` - Every possible log message will be shown. This will use a lot of disk space and is not recommended unless you are a developer / like reading code.
  16. * `ERROR` - OliveTin rarely uses the `ERROR` log level.
  17. * `WARN` - Very few messages, only warnings are shown.
  18. * `INFO` - The defualt log level.
  19. You can change the `logLevel` while OliveTin is running, and it should update as soon as you save your config.yaml. You will always get a log message like this;
  20. [source,bash]
  21. ----
  22. INFO Setting log level to warning
  23. ----
  24. == JSON Log Format
  25. * OliveTin 2k supports JSON log format from version **2025.10.30**.
  26. * OliveTin 3k supports JSON log format from version **3000.2.2**.
  27. You can enable JSON log format by setting the `OLIVETIN_LOG_FORMAT` environment variable to `json`.
  28. [source,bash]
  29. .Example of setting `OLIVETIN_LOG_FORMAT` to `json`.
  30. ----
  31. root@server: ./OliveTin
  32. {"commit":"nocommit","date":"nodate","level":"info","msg":"OliveTin initializing","time":"2025-10-30T10:09:55Z","version":"dev"}
  33. {"level":"debug","msg":"Value of -configdir flag","time":"2025-10-30T10:09:55Z","value":"."}
  34. {"level":"debug","msg":"servicehost nonwin","time":"2025-10-30T10:09:55Z"}
  35. {"level":"info","msg":"Setting log level to info","time":"2025-10-30T10:09:55Z"}
  36. {"level":"info","msg":"OliveTin initialization complete","time":"2025-10-30T10:09:55Z"}
  37. {"configDir":"/home/xconspirisist/sandbox/Development/OliveTin/OliveTin","level":"info","msg":"OliveTin started","time":"2025-10-30T10:09:55Z"}
  38. ----