logging.rst.inc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Logging
  2. ~~~~~~~
  3. Borg writes all log output to stderr by default. However, output on stderr does
  4. not necessarily indicate an error. Check the log levels of the messages and the
  5. return code of borg to determine error, warning, or success conditions.
  6. If you want to capture the log output to a file, just redirect it:
  7. ::
  8. borg create --repo repo archive myfiles 2>> logfile
  9. Custom logging configurations can be implemented via BORG_LOGGING_CONF.
  10. The log level of the built-in logging configuration defaults to WARNING.
  11. This is because we want Borg to be mostly silent and only output
  12. warnings, errors, and critical messages unless output has been requested
  13. by supplying an option that implies output (e.g., ``--list`` or ``--progress``).
  14. Log levels: DEBUG < INFO < WARNING < ERROR < CRITICAL
  15. Use ``--debug`` to set the DEBUG log level —
  16. this prints debug, info, warning, error, and critical messages.
  17. Use ``--info`` (or ``-v`` or ``--verbose``) to set the INFO log level —
  18. this prints info, warning, error, and critical messages.
  19. Use ``--warning`` (default) to set the WARNING log level —
  20. this prints warning, error, and critical messages.
  21. Use ``--error`` to set the ERROR log level —
  22. this prints error and critical messages.
  23. Use ``--critical`` to set the CRITICAL log level —
  24. this prints only critical messages.
  25. While you can set miscellaneous log levels, do not expect every command to
  26. produce different output at different log levels — it's merely a possibility.
  27. .. warning:: Options ``--critical`` and ``--error`` are provided for completeness,
  28. their usage is not recommended as you might miss important information.