- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Write standard logs to stdout and JSON logs to a file #523
Comments
@apgrucza interesting idea, I'm not sure the current logging system can handle that, I do have some tentative plans to overhaul it but not anytime soon. How are you thinking this would work? We'd need a way to state output to stdout and output to a log file or is stdout always a thing and you can just specify an additional output and format? |
We have a similar process that runs AWS Nuke regularly, and would like to perform queries against our logs to see what actually happened in a given run, which is easy with JSON-structured logging. Expanding on the suggestion, I think supporting either standard/JSON logs to both stdout/a file would be best. Perhaps the config could support a list of log destinations, which could be stdout, a file, or something else, with a configuration property for log format Also, we run this process in a central account that assumes a role into other accounts. The ability to add fields to the logs that get emitted would help us add things like |
If using logrus, the readme says you can use hooks to log to multiple places simultaneously. I'm going to assume the only destinations we need to support are I'm not sure if we would want to allow different log options (
But if we want to allow different log options per destination then I think it would get too messy configuring this via CLI options. Using the config file would be better. But I also would like to retain the ability to set the log level via the log_file:
path: aws-nuke-log.json
format: json
level: trace
caller: true
full-timestamp: true If you forsee the need to support log destinations other than these, then the above config could be changed to a YAML array instead. |
Thanks for the feedback. I will try and take a look at this when I can. |
I have a job that runs AWS Nuke weekly. It outputs logs in the standard format, which is good for reviewing the results because it is human-readable. But sometimes I want to do some analysis on the results which is much easier when the logs are in JSON format.
I'd like to keep the stdout logs as-is but be able to also specify a file to write logs to (either in JSON format, or in a configurable format).
The text was updated successfully, but these errors were encountered: