reactor-netty icon indicating copy to clipboard operation
reactor-netty copied to clipboard

Netty does not provide errorLog just accesLog

Open paulbors opened this issue 1 year ago • 1 comments

As a system administrator, I would like to see errorLogs in Netty web server similar to those of Apache HTTPD when the client socket is closed and we receive no accessLog.

Motivation

Netty web server does not log web server errors for requests that do not complete (ie: connection terminated is not captured in accessLog which should really be following Apache HTTPD errorLog).

Desired solution

A new ChannelDuplexHandler is added similar to BaseAccessLogHandler and its counterparts but for logging the web server access errors only.

Considered alternatives

One could increase the logs to trace to follow the channel termination exception log events, but that is too verbose for a production environment.

Additional context

Implement a similar errorLogs as those of Apache HTTPD: https://httpd.apache.org/docs/2.4/logs.html#page-header

paulbors avatar May 22 '24 19:05 paulbors

@paulbors Are you interested in providing a PR? Which Reactor Netty version should enable this feature (1.1.x or 1.2.x)?

violetagg avatar May 23 '24 07:05 violetagg

@violetagg

Hello! I would like to work on this issue. Before proceeding, I have a few questions for clarification.

  1. Should I approach this by adding an ErrorLogHandler similar to BaseAccessLogHandler?
  2. Should an error log be recorded for all cases where a connection is disconnected or closed, and should all exceptions also be logged as errors?

If I’ve misunderstood anything or if there’s any additional information you can share, I’d appreciate your guidance! Thank you!

raccoonback avatar Feb 16 '25 15:02 raccoonback

Should I approach this by adding an ErrorLogHandler similar to BaseAccessLogHandler?

@raccoonback I haven't thought about any particular implementation, so we can try adding an ErrorLogHandler similar to BaseAccessLogHandler.

They mention Implement a similar errorLogs as those of Apache HTTPD, can you give me more information about this?

violetagg avatar Feb 17 '25 08:02 violetagg

@paulbors Hello! Please explain in more detail.

Implement a similar errorLogs as those of Apache HTTPD: https://httpd.apache.org/docs/2.4/logs.html#page-header

raccoonback avatar Feb 17 '25 14:02 raccoonback

@violetagg

As a system administrator, I would like to see errorLogs in Netty web server similar to those of Apache HTTPD when the client socket is closed and we receive no accessLog.

Maybe.. It seems they want to access server-side error logs related to client socket closed and exceptions.

In Apache HTTPD, it appears that a lot of information besides network is logged in ErrorLog...

[Sat Jan 01 00:00:00.000000+0900] [error] [client 192.168.1.100] client denied by server configuration: /export/test

I would like to first define it as follows. we can just log connection close info and exception info with ErrorLog. What do you think about this?

raccoonback avatar Feb 17 '25 14:02 raccoonback