aetaric/checkrr

[Feature] Log file output/rotation

Closed this issue · 4 comments

The config example has a logfile directive, but it doesn't seem to be wired up. It'd be useful to support logging to files (perhaps one for the web server and one for scan actions) with rotation support instead of just to stdout.

Patched in 3fc36d7

You're a time traveler!

Sorry for posting in a closed GHI. Is this already in the docker image? Seems to behave like pre commit (debug flag - no debug output, according to start up on info, log file never gets written.
As a side note, a GH workflow that builds the image automatically on commits and pushes it to the repo of your choice (gh, docker) would be fantastic.

edit: looks like i'm tired, seeing this on 3.1.1, but 1am, will play around tomorrow

Docker images are built by GoReleaser as part of my build process. It builds all the docker images and deploys a manifest for the set. Using GH workflows would be a bit much for all that since I prefer to release to versions in tags.

Yes, it's already in the docker image. Make sure you expose the log file to the host via a docker mount, otherwise it will seem like it's doing nothing but will just be logging to a file inside the container.

---
checkrr:
  logfile: /checkrr.log

docker run -v /mnt/user/checkrr/checkrr.log:/checkrr.log ........

Some setup like that. I have log output as you can see here:

➜  checkrr git:(main) cat checkrr.log 
INFO[0000] Next Run: 2023-01-22 16:57:00 -0700 MST      
WARN[0056] No config options for notifications found.    Notifications Connected=false Startup=true
...
INFO[0057] File "test/movies/BBB-test.mkv" is not a recognized file type  FFProbe=false Type=Unknown
INFO[0057] Couldn't find a target for file "test/movies/BBB-test.mkv". File is unknown.  Unknown File=true
INFO[0057] "test/movies/Big Buck Bunny (Sunflower Movie Version) (2008).mp4"  Hash Match=true
INFO[0057] Next Run: 2023-01-22 16:58:00 -0700 MST