Option to disable syslog output #484

Closed
opened 2021-12-30 22:02:17 +00:00 by Alexander-Shukaev · 4 comments

What I'm trying to do and why

Running borgmatic as a systemd service.

Steps to reproduce (if a bug)

Run borgmatic as a systemd service with --verbosity 1 --monitoring-verbosity 1 --syslog-verbosity -1 options.

Actual behavior (if a bug)

borgmatic.service[574202]: ...: Error running pre hook
borgmatic[574202]: CRITICAL ...: Error running pre hook
borgmatic.service[574202]: Command '...' returned non-zero exit status 1.
borgmatic[574202]: CRITICAL Command '...' returned non-zero exit status 1.
borgmatic.service[574202]: ...: Running command for on-error hook
borgmatic.service[574202]: All given configuration files are valid: ...
borgmatic[574202]: ERROR All given configuration files are valid: ...

Notice how borgmatic duplicates most of the error-related output into the syslog even though the service has already done it.

Expected behavior (if a bug)

syslog-verbosity -1 should disable any explicit syslog output from borgmatic as it's redundant under systemd use case or any other similar one, where logging is done in a different manner.

Environment

borgmatic version: 1.5.21

Borg version: 1.1.17

Python version: 3.10.1

#### What I'm trying to do and why Running `borgmatic` as a `systemd` service. #### Steps to reproduce (if a bug) Run `borgmatic` as a `systemd` service with `--verbosity 1 --monitoring-verbosity 1 --syslog-verbosity -1` options. #### Actual behavior (if a bug) ``` borgmatic.service[574202]: ...: Error running pre hook borgmatic[574202]: CRITICAL ...: Error running pre hook borgmatic.service[574202]: Command '...' returned non-zero exit status 1. borgmatic[574202]: CRITICAL Command '...' returned non-zero exit status 1. borgmatic.service[574202]: ...: Running command for on-error hook borgmatic.service[574202]: All given configuration files are valid: ... borgmatic[574202]: ERROR All given configuration files are valid: ... ``` Notice how `borgmatic` duplicates most of the error-related output into the `syslog` even though the service has already done it. #### Expected behavior (if a bug) `syslog-verbosity -1` should disable any explicit `syslog` output from `borgmatic` as it's redundant under `systemd` use case or any other similar one, where logging is done in a different manner. #### Environment **borgmatic version:** 1.5.21 **Borg version:** 1.1.17 **Python version:** 3.10.1
Owner

Thanks for filing this! I think to make this work, I'd have to introduce another verbosity level even lower than -1 (such as -2, disabled, etc.). That's because the existing -1 verbosity level is errors only, and it would probably be good to keep that available.

Thanks for filing this! I think to make this work, I'd have to introduce another verbosity level even lower than `-1` (such as `-2`, `disabled`, etc.). That's because the existing `-1` verbosity level is errors only, and it would probably be good to keep that available.
witten added the
good first issue
label 2023-02-04 17:41:20 +00:00
Owner

Adding a note for anyone who picks up this ticket: It would probably be a good idea to alter the sample systemd service with whatever solution is employed here. (--syslog-verbosity -2, --syslog-verbosity disabled, etc.).

Adding a note for anyone who picks up this ticket: It would probably be a good idea to alter the sample systemd service with whatever solution is employed here. (`--syslog-verbosity -2`, `--syslog-verbosity disabled`, etc.).
Owner

@Soumik_Dutta has implemented this in main as a new verbosity level of -2. It will be available in the next release!

@Soumik_Dutta has implemented this in main as a new verbosity level of `-2`. It will be available in the next release!
Owner

Just released as part of borgmatic 1.7.14!

Just released as part of borgmatic 1.7.14!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#484
No description provided.