eht16 / python-logstash-async

Python logging handler for sending log events asynchronously to Logstash.
MIT License
182 stars 52 forks source link

Log level of: "An error occurred while sending events: [Errno 104] Connection reset by peer" #71

Closed istvan-derda closed 2 years ago

istvan-derda commented 2 years ago

Hey Enrico, first, thank you for this amazing library! Great to see people putting time and effort in open-source software.

Now my Issue: It seems, that something is not perfect with the network in our QA-Environment, I get a lot of "An error occurred while sending events: [Errno 104] Connection reset by peer" from your library (worker.py line 216). Since you took care of handling this well, this is not a big problem. The logs are put back in the queue and are sent immediately after, when the connection is back.

My request: Since the error is handled in the code, can we lower the log level of these messages? I only want Errors logged, if something in my application is actually broken. So I would propose to change the log level of these messages to WARN.

Reasoning: Nothing is broken, there is just some networking hiccup, that is handled by the library. Logged Errors like these distract us from seeing, when something is actually broken.

If you like, I can open a Pull-Request to propose a solution.

Yours István

eht16 commented 2 years ago

Hey Enrico, first, thank you for this amazing library! Great to see people putting time and effort in open-source software.

Glad you like it!

My request: Since the error is handled in the code, can we lower the log level of these messages? I only want Errors logged, if something in my application is actually broken. So I would propose to change the log level of these messages to WARN.

Good idea. I changed the log level for network related errors to WARNING. Included in the new release 2.4.0.

istvan-derda commented 2 years ago

Thank you for the quick response :)