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

[FR]: Machine redable logs #240

Open
1 of 2 tasks
ryanwalder opened this issue Mar 18, 2023 · 3 comments
Open
1 of 2 tasks

[FR]: Machine redable logs #240

ryanwalder opened this issue Mar 18, 2023 · 3 comments
Assignees
Labels
feature request New feature or request

Comments

@ryanwalder
Copy link

Is your feature request related to a problem? Please elaborate.

The current logging system is great for interactive running of qbit_manage but it is unfortunately not machine readable which makes meaningful logging of qbit_manage impossible.

Describe the solution you'd like

I would like to have an option in the config which switches the output from the human readable logging to something machine readable.

Example:

|===================================== Updating Tags ======================================|
|    Torrent Name: FooBar.1974.720P.BluRay.x264.FLAC.2.0                            |
|         New Tag: trackerName                                                                     |
|         Tracker: http://my.tracker                                    |
|     Share Limit: Max Seed Time = None min                                                |
| Updated 1 new tags.                                                                      |

Could become:

JSON format:

{"timestamp": "2023-03-18 14:54:39,806", "log_level": "INFO", "subsystem": "tag_updater", "torrent_name": "FooBar.1974.720P.BluRay.x264.FLAC.2.0", "new_tag": "trackerName", "share_limit": {"max_seed_time": "None"}

Or use a library like syslog without custom formatting to output something like:

2023-03-18 14:54:39,806 qbit_manage: [INFO] Updated Tags for FooBar.1974.720P.BluRay.x264.FLAC.2.0 new tag: trackerName share limit: None

Does your solution involve any of the following?

  • New config option
  • New command option

Describe alternatives you've considered

No reasonable alternative.

Who will this benefit?

This would allow people who prefer standard logging methods to use their preferred tooling to search logs using standard tools like grep this would also benefit those who have centralised logging in their setups (Graylog, Loki, ELK etc.).

Additional Information

No response

@bobokun
Copy link
Collaborator

bobokun commented May 22, 2023

Unfortunately to make this change would require a lot of refactoring as each line is sent separately. However, would it help if I added a feature that could save the webhook jsons into a file for you to process?

@bakerboy448
Copy link
Collaborator

maybe see if chatgpt can do some refactoring?

@ryanwalder
Copy link
Author

Unfortunately to make this change would require a lot of refactoring as each line is sent separately. However, would it help if I added a feature that could save the webhook jsons into a file for you to process?

That could possibly work, would ideally need timestamps though.

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

No branches or pull requests

3 participants