borgmatic-collective / docker-borgmatic

Borgmatic in Docker
GNU General Public License v3.0
358 stars 94 forks source link

Log output altered by Supercronic, becomes difficult to read #203

Closed accolon closed 1 year ago

accolon commented 1 year ago

After updating to 1.7.6, the log output of the Borgmatic Docker container has become difficult to read since Supercronic is rather chatty, e.g.:

time="2023-02-02T18:23:35+01:00" level=info msg="                       Original size      Compressed size    Deduplicated size" channel=stdout iteration=0 job.command="PATH=$PATH:/usr/local/bin /usr/local/bin/borgmatic --stats -v 0 2>&1" job.position=0 job.schedule="23 * * * *"
time="2023-02-02T18:23:35+01:00" level=info msg="This archive:                3.22 GB              3.10 GB             10.86 MB" channel=stdout iteration=0 job.command="PATH=$PATH:/usr/local/bin /usr/local/bin/borgmatic --stats -v 0 2>&1" job.position=0 job.schedule="23 * * * *"

While this could be parsed automatically, it is quite difficult to read in a terminal session. I liked the old and simple output more.

Supercronic has a -passthrough-logs flag which avoids all the additional info: https://github.com/aptible/supercronic/pull/67

It would be great if the supercronic call in entry.sh either added this flag (to emulate the old cron) or could support options to make this configurable.

chrissi5120 commented 1 year ago

Hi,

just want to confirm your findings, I got the same behavior.

Regards

Christoph

grantbevis commented 1 year ago

Thanks for the report @accolon and @chrissi5120 - Is the request to simply add -passthrough-logs to the supercronic starting flags so it mimics old cron? Or would a better middle ground be the ability to add custom flags through an envar like SUPERCRONIC_EXTRA_FLAGS= ?

I'm leaning towards the second option if I am honest, this would then allow people to switch on the prometheus /metrics endpoint etc too.

chrissi5120 commented 1 year ago

Hi!

personally I would always opt for an envar which is of course optional and well documented.

Thank you for your hard work.

accolon commented 1 year ago

I'm leaning towards the second option if I am honest, this would then allow people to switch on the prometheus /metrics endpoint etc too.

Sounds great, thanks! 👍

grantbevis commented 1 year ago

@accolon / @chrissi5120 - This feature has been tested and added under #205 - I've tested locally and it seems to work as intended

image

This will be picked up by CI/CD which will build this change into the next :latest image, please may I ask you pull and test this and let me know your feedback

accolon commented 1 year ago

Works very well for my use case, thanks again! ☺️

The additional output by Supercronic combined with the unaltered Borgmatic output (after adding -passthrough-logs) is exactly what I need.

chrissi5120 commented 1 year ago

image

success :)

I just used SUPERCRONIC_EXTRA_FLAGS with "-passthrough-logs" to begin with and nothing fancy like you guys.

Thank you very much!

modem7 commented 1 year ago

Closing as seems to be resolved with https://github.com/borgmatic-collective/docker-borgmatic/pull/205