Logging and stdout behaviour of --files and --stats is confusing #547
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#547
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I had originally posted this in #524, but I don't think that was the right place, sorry for the confusion. Quoting from that thread:
In my opinion, the logic of what gets logged, and where, is difficult to figure out for the user and feels buggy. Of course that's just my personal opinion and you're free to design your software as you like.
To explain:
I would like to have
--files
and--stats
info output to the log, and keep stdout relatively clean, to just verify that the backup job ran successfully.To do this, I run with
-v 0 --log-file "$bm_log" --log-file-verbosity 1
, then issuecreate --files --stats
on my command line.I can confirm this adds the appropriate flags to the borg command call:
--list --filter AME- --info --stats
, and the expected output shows up in the borg logs, which I've redirected with my own logging.conf file.Given that I know borg outputs the file list and stats at the INFO level, I would not expect to see the info on stdout from borgmatic (because of
-v 0
), but I would expect to see it in borgmatic's logs, because I'm running with verbosity 1 there.In fact, borgmatic prints the file list and stats to neither stdout nor the log. I find this confusing.
Based on the logic described above, I'm not sure whether this is a bug, or the intended behaviour.
--stats
is issued on the command line, but the verbosity level is not sufficient that the information will actually be shown.Environment
borgmatic version: 1.6.3
borgmatic installation method: pip
Borg version: 1.1.17
Python version: Python 3.10.4
operating system and version: macOS 10.14.6
Logging behaviour of --files and --stats is confusingto Logging and stdout behaviour of --files and --stats is confusingThank you for taking the time to file this! I'd love to make the logging logic more intuitive (and documented). However, I haven't been able to reproduce the issue you've described. I'm running borgmatic master (so, 1.6.3), and when I run the following, I get no output on stdout and full stats/files output in the log file:
Here's my config file:
If I change
-v 0
to-v 1
, then I get stats/files output on both stdout and in the log.So maybe there's a meaningful difference between our respective command-lines? Can I get a look at your entire command? Thanks!
Shoot, it was my fault -- having a logging.conf in place for Borg was evidently preventing borgmatic from getting the output. Once I did
export -n BORG_LOGGING_CONF
andunset BORG_LOGGING_CONF
, the output is as you describe, with a quiet stdout and the full stats and file-list blast in borgmatic's log.Okay, no worries! Glad that's all it was. If you find any other logging irregularities (I'm sure there are some, given the complexity), please don't hesitate to let me know.
Thanks, I will report if I notice any irregularities -- it's strange because I only created the
logging.conf
for Borg after I noticed what I thought was unexpected behaviour with borgmatic's logging. I did recently upgrade borgmatic from a much earlier version, so maybe it was an issue that got fixed along the way. Or maybe I just had my command lines tangled up all along. :-)Things have definitely changed since early versions of borgmatic logging, so it could very well be that!