Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add an option to send all log messages to a file [PR welcome] #200

Open
lollingtonbear opened this issue Dec 3, 2024 · 2 comments

Comments

@lollingtonbear
Copy link

I would like an option to send all log messages to a file.

The logs don't appear in journal and there doesn't seem to be a log file, it just outputs to pythons stdout.

I run decluttarr as systemd service, and I've tried using common methods to direct output to a file but the file remains empty. Assuming the issue is not just me being crap, I'd like an option to output log messages to file.

@ManiMatter
Copy link
Owner

ManiMatter commented Dec 4, 2024

Hi @lollingtonbear
Thanks for bringing up the idea. I am a little bit stretched these days and wont be able to do it, but happy to review a PR if you‘d like to contribute

Some pointers, where I think you'd need to changes:

  • config/config.conf-Example -> Add a new parameter "LOG_FILE_OUTPUT" boolean
  • config/definitions.py -> Load the LOG_FILE_OUTPUT (probably under "General")
  • src/loadScripts.py -> add to the def showSettings(settingsDict) the new LOG_FILE_OUTPUT
  • src/main.py -> where "Set up logging" is written, add another handler if LOG_FILE_OUTPUT is true, which then outputs to a file. You may need to think of file rotation to prevent that the files become too large
  • README.md
    -> Add the new parameter to the docker-compose example, and explain the new LOG_FILE_OUTPUT under "Explanation of the settings"/"General"
    -> Specify the folder that needs to be mounted in docker-compose so that from the hosting system the logs can be seen. Example:
   volumes:
     - $DOCKERDIR/appdata/decluttarr/logs:/logs 

@ManiMatter ManiMatter changed the title [Feature Request] Add an option to send all log messages to a file [Feature Request] Add an option to send all log messages to a file [PR welcome] Dec 4, 2024
@lollingtonbear
Copy link
Author

lollingtonbear commented Dec 4, 2024

Thanks. While I can code, (Java, Bash, Powershell, Pascal (I'm old)) I've not tried Python. This could be a good way to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants