-
Notifications
You must be signed in to change notification settings - Fork 92
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
Catching erros from app #105
Comments
@ambrous Maybe I misunderstood the issue, but catching all logs or just errors should not be a problem. OpenTAXII writes logs in json-lines format, where every log-line is a json message. The logging level you can control with |
@traut thanks a lot for your answer! Yes, I tried to change logging level in loggin section in our server config, but with any level all logs are written into stdout, including errors as log-line json string (as you mentioned). However I need writing error into stderr. As I understand, by logging level we can manage what kind of logs we want to see in our log, but can't write error to other log file or stream. Right? |
ah, now I see what you mean!
correct. You would have to write/use your own stream handler. This is not something OpenTAXII supports out of the box. I feel you can catch / redirect |
@traut Thanks for your help! I have had some experiments with gunicorn config, but with unsuccssed result, Then I found that gunicorn error log ONLY for error within gunicorn server (it was discussed here benoitc/gunicorn#1124). I just thought that this might be supported out of the box. So it seem to me that I really have to find other way. So the issue must be closed. |
@ambrous good luck! |
Hi!
I am using OpenTAXII of version of 0.1.9 with gunicorn web server.
When an error occurs in my custom api or data converters the error it written to usual log file with other information which I write myself. So I can't set up my monitoring system to detect only error, but not all info from log.
I have following gunicorn start command:
gunicorn opentaxii.http:app --bind localhost:7070
--timeout 300
--max-requests 100
--max-requests-jitter 20
--access-logfile /var/log/access-taxii.log
--error-logfile /var/log/error-taxii.log
--log-level info
As I understand all errors are catched by middleware by handle_internal_error function to respond xml then, so how can I forward this catched error to error log file as well?
I tried to use default gunicorn config (http://www.opentaxii.org/en/stable/running.html), but had the same case.
Thanks in advance!
The text was updated successfully, but these errors were encountered: