-
Notifications
You must be signed in to change notification settings - Fork 690
Support error log handler for Http server #3700
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
Conversation
- Introduce a new ChannelDuplexHandler to log errors similar to Apache HTTPD errorLog - Ensure that error logs are recorded separately from access logs Signed-off-by: raccoonback <[email protected]>
Signed-off-by: raccoonback <[email protected]>
Signed-off-by: raccoonback <[email protected]>
Signed-off-by: raccoonback <[email protected]>
reactor-netty-http/src/main/java/reactor/netty/http/server/Http3Codec.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java
Show resolved
Hide resolved
...-http/src/main/java/reactor/netty/http/server/logging/error/AbstractErrorLogArgProvider.java
Show resolved
Hide resolved
...or-netty-http/src/main/java/reactor/netty/http/server/logging/error/BaseErrorLogHandler.java
Outdated
Show resolved
Hide resolved
...or-netty-http/src/main/java/reactor/netty/http/server/logging/error/ErrorLogArgProvider.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/logging/error/ErrorLogFactory.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerConfig.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerConfig.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServerConfig.java
Show resolved
Hide resolved
violetagg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raccoonback Thanks for the PR!
I have some minor comments and questions. Please check them.
reactor-netty-core/src/main/java/reactor/netty/NettyPipeline.java
Outdated
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/Http3Codec.java
Outdated
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java
Outdated
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java
Show resolved
Hide resolved
...netty-http/src/main/java/reactor/netty/http/server/logging/error/DefaultErrorLogHandler.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/logging/error/ErrorLog.java
Outdated
Show resolved
Hide resolved
...or-netty-http/src/main/java/reactor/netty/http/server/logging/error/ErrorLogArgProvider.java
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/server/logging/error/ErrorLogFactory.java
Show resolved
Hide resolved
reactor-netty-http/src/test/java/reactor/netty/http/server/logging/error/ErrorLogTest.java
Show resolved
Hide resolved
...or-netty-http/src/main/java/reactor/netty/http/server/logging/error/BaseErrorLogHandler.java
Outdated
Show resolved
Hide resolved
reactor-netty-http/src/test/java/reactor/netty/http/server/logging/error/ErrorLogTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: raccoonback <[email protected]>
…part of the initialization target Signed-off-by: raccoonback <[email protected]>
Signed-off-by: raccoonback <[email protected]>
ref. reactor#3700 (comment) Signed-off-by: raccoonback <[email protected]>
Signed-off-by: raccoonback <[email protected]>
Signed-off-by: raccoonback <[email protected]>
Signed-off-by: raccoonback <[email protected]>
…exceptions Signed-off-by: raccoonback <[email protected]>
Signed-off-by: raccoonback <[email protected]>
|
@violetagg |
… HTTP server Signed-off-by: raccoonback <[email protected]>
...netty-http/src/main/java/reactor/netty/http/server/logging/error/DefaultErrorLogHandler.java
Show resolved
Hide resolved
Signed-off-by: raccoonback <[email protected]>
|
@violetagg |
violetagg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Signed-off-by: Violeta Georgieva <[email protected]>
Signed-off-by: Violeta Georgieva <[email protected]>
… HttpServerInfos HttpServerInfos#connectionRemoteAddress() gives the correct connection remote address for all HTTP versions. This is important for the HTTP/3 use case. Add tests for HTTP/3 use case. Related to #3700 Signed-off-by: Violeta Georgieva <[email protected]>
… HttpServerInfos (#3750) HttpServerInfos#connectionRemoteAddress() gives the correct connection remote address for all HTTP versions. This is important for the HTTP/3 use case. Add tests for HTTP/3 use case. Related to #3700 Signed-off-by: Violeta Georgieva <[email protected]>
Description
This PR introduces an error logging mechanism similar to Apache HTTPD's errorLog, addressing #3257.
Currently, Reactor Netty does not log errors when exceptions are fired, so this update ensures that such errors are captured separately from access logs.
Key Changes
DefaultErrorLogHandlerhandler to log error when exceptions are fired.ErrorLogFactory.Log format customization, similar to
AccessLog, is available usingErrorLogFactory.ErrorLogFactory.Filtering information includes
RemoteAddress,HttpServerInfos,andThrowable.Related Issue
Additional Context
For reference, this implementation follows the Apache HTTPD error log format:
🔗 Apache HTTPD Error Log Documentation