-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Add information about nio channels in logs #26806
Conversation
Currently we only log generic messages about errors in logs from the nio event handler. This means that we do not know which channel had issues connection, reading, writing, etc. This commit changes the logs to include the local and remote addresses and profile for a channel.
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.
I left one comment, otherwise LGTM.
public void acceptException(NioServerSocketChannel nioServerChannel, Exception exception) { | ||
logger.debug("exception while accepting new channel", exception); | ||
void acceptException(NioServerSocketChannel nioServerChannel, Exception exception) { | ||
logger.debug(new ParameterizedMessage("exception while accepting new channel from server channel: {}", |
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.
Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?
public void genericServerChannelException(NioServerSocketChannel channel, Exception exception) { | ||
logger.debug("event handling exception", exception); | ||
void genericServerChannelException(NioServerSocketChannel channel, Exception exception) { | ||
logger.debug(new ParameterizedMessage("exception while handling event for server channel: {}", channel), exception); |
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.
Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?
* @param exception that occurred | ||
*/ | ||
void closeException(NioChannel channel, Exception exception) { | ||
logger.debug(new ParameterizedMessage("exception while closing channel: {}", channel), exception); |
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.
Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?
public void registrationException(NioSocketChannel channel, Exception exception) { | ||
logger.trace("failed to register channel", exception); | ||
void registrationException(NioSocketChannel channel, Exception exception) { | ||
logger.debug(new ParameterizedMessage("failed to register socket channel: {}", channel), exception); |
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.
Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?
public void connectException(NioSocketChannel channel, Exception exception) { | ||
logger.trace("failed to connect to channel", exception); | ||
void connectException(NioSocketChannel channel, Exception exception) { | ||
logger.debug(new ParameterizedMessage("failed to connect to socket channel: {}", channel), exception); |
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.
Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?
public void readException(NioSocketChannel channel, Exception exception) { | ||
logger.trace("failed to read from channel", exception); | ||
void readException(NioSocketChannel channel, Exception exception) { | ||
logger.debug(new ParameterizedMessage("exception while reading from socket channel: {}", channel), exception); |
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.
Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?
public void writeException(NioSocketChannel channel, Exception exception) { | ||
logger.trace("failed to write to channel", exception); | ||
void writeException(NioSocketChannel channel, Exception exception) { | ||
logger.debug(new ParameterizedMessage("exception while writing to socket channel: {}", channel), exception); |
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.
Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?
public void genericChannelException(NioSocketChannel channel, Exception exception) { | ||
logger.trace("event handling failed", exception); | ||
void genericChannelException(NioSocketChannel channel, Exception exception) { | ||
logger.debug(new ParameterizedMessage("exception while handling event for socket channel: {}", channel), exception); |
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.
Since this is at the debug level, should you use a supplier here to avoid instantiating the parameterized message if not needed?
Currently we only log generic messages about errors in logs from the nio event handler. This means that we do not know which channel had issues connection, reading, writing, etc. This commit changes the logs to include the local and remote addresses and profile for a channel.
Currently we only log generic messages about errors from the
nio event handler. This means that we do not know which channel had
issues connection, reading, writing, etc.
This commit changes the logs to include the local and remote addresses
and profile for a channel.