Skip to content

Conversation

@raccoonback
Copy link
Contributor

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

  • Add DefaultErrorLogHandler handler to log error when exceptions are fired.
  • The log format can be customized just like AccessLog using ErrorLogFactory.
    Log format customization, similar to AccessLog, is available using ErrorLogFactory.
  • Filtering can also be done using ErrorLogFactory.
    Filtering information includes RemoteAddress, HttpServerInfos, and Throwable.

Related Issue

Additional Context

For reference, this implementation follows the Apache HTTPD error log format:
🔗 Apache HTTPD Error Log Documentation

- 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]>
Copy link
Member

@violetagg violetagg left a 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.

@violetagg violetagg linked an issue Apr 10, 2025 that may be closed by this pull request
@violetagg violetagg added the type/enhancement A general enhancement label Apr 11, 2025
@violetagg violetagg added this to the 1.2.6 milestone Apr 11, 2025
@raccoonback raccoonback requested a review from violetagg April 16, 2025 23:10
@raccoonback
Copy link
Contributor Author

@violetagg
Thank you for the review!
I've reflected all of your comments!

@raccoonback raccoonback requested a review from violetagg April 22, 2025 23:17
@raccoonback
Copy link
Contributor Author

@violetagg
I’ve applied the review feedback!

Copy link
Member

@violetagg violetagg left a 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!

@violetagg violetagg merged commit 2d585b6 into reactor:1.2.x Apr 29, 2025
14 checks passed
violetagg added a commit that referenced this pull request Apr 30, 2025
Signed-off-by: Violeta Georgieva <[email protected]>
violetagg added a commit that referenced this pull request Apr 30, 2025
Signed-off-by: Violeta Georgieva <[email protected]>
violetagg added a commit that referenced this pull request May 5, 2025
… 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]>
violetagg added a commit that referenced this pull request May 5, 2025
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Netty does not provide errorLog just accesLog

2 participants