-
Notifications
You must be signed in to change notification settings - Fork 136
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
Log file path optional parameter #45
Comments
Hi and thanks for raising this. I understand your motivation, but I think this won't be easily solved in the exporter itself. Proper logging is serious business, so if we start going down this route, the following questions will come up:
Things will become arbitrarily complex, with every user having a different preference based on their use case. Hence, the best thing to do (in my opinion at least) is to keep the interface simple (write to stdout) and leave everything else to software designed for these things, such as systemd/journald. Now, I don't just want to brush this off, so let's talk about your specific problem. The solution you are asking for could be easily achieved by having systemd redirect the stdout elsewhere, e.g. using But then you end up with this log file that might be blowing up over time. As long as you use journald, at least it does some rotating and such for you. So maybe an even better option would be to take a closer look at journald's rate limiting capabilities or log size limitation settings to see if you can tune them to something that suits your needs (note that unfortunately AFAIK journald settings are global and apply to all services)? Maybe you can elaborate a little. What were the actual problems you observed? Did the amount of logs slow down journald and/or the host? Did they fill the file system? Or were they just a nuisance? If you were to write the logs to a file, what would you do with that file? How would you make sure it doesn't grow too big? I hope you understand that I am not to keen to add advanced logging options to the exporter. But I am genuinely interested in making this work for you, so I'd appreciate if you let me know if any of the suggestions work for you or else provide a few more details, e.g. answers to the questions above. I am sure this will be useful to others. |
Dear @bitfehler , Many thanks for this very detailed answer. I understand your concerns, and on my side your solution based on StandardOutput is enough. Regarding the context: I am working on an opensource stack (https://bluebanquise.com/, https://github.com/oxedions/bluebanquise), and the stack is used on HPC (High Performance Computing) clusters. We are currently integrating Prometheus monitoring (metrics and alerts). I will let you know once I made the systemctl file modification with StandardOutput if it works as expected. |
Dear @bitfehler, As promised, a feedback. Tests were made on an RHEL 7.7. I couldn't have systemctl to log files, as expected in the documentation. I used this service file:
I tried using both StandardOutput/StandardError, or StandardError only (commented here), as I have seen ipmi exporter output in stderr when using command line. But /var/log/ipmi_exporter.log remains empty. This is not a bug on your side, and so I will ask RedHat about this. Will keep you informed once I get an answer. Best regards |
Hi,
I am using the ipmi_exporter (works like a charm !) on some huge systems, and sometime when a range of nodes are down (including BMC), I can face thousands of error.
Currently, all logs are sent to system log, which "pollute" it. Is there a simple way to add a login file path to parameters ?
My current systemctl file is:
I could find --log.level or --log.format, but nothing related to an optional log file path.
Please consider this not as a critical issue, but only asking if some kind of mechanism exist for this tool to store logs in a dedicated file.
Best regards
Ox
The text was updated successfully, but these errors were encountered: