[ 
https://issues.apache.org/jira/browse/SSHD-1058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17179456#comment-17179456
 ] 

Lyor Goldstein commented on SSHD-1058:
--------------------------------------

{quote}
I think the policy may have been applied a bit too quickly in some places.

The policy is about displaying the stack trace in the log (so that the user is 
not left without any indication about the stack trace), not about raising the 
log level for all exceptions that were previously logged at debug/trace level.
{quote}
[~gnodet] I am fine if you want to implement something else in this case - 
though perhaps a review of all the other cases may also be in order...

> ChannelOutputStream#flush should not log at error level
> -------------------------------------------------------
>
>                 Key: SSHD-1058
>                 URL: https://issues.apache.org/jira/browse/SSHD-1058
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 2.5.0, 2.5.1
>         Environment: Linux, Java 11
>            Reporter: Markus Spann
>            Assignee: Guillaume Nodet
>            Priority: Minor
>
> When calling flush on ChannelOutputStream, Window.waitForSpace may throw a 
> WindowClosedException. This exception is always logged at error level, then 
> rethrown. If Debug is enabled on the logger, the error log is issued twice 
> (second time with stacktrace).
> During deinitialization it is common practice to call flush on output 
> streams. Due to the asynchronous nature of the code in this library, the call 
> may fail. The caller should decide how to deal with the exception and log at 
> error level if needed.
> The implementation should not log at error level regardless.
> I would suggest INFO level instead (if logging at all).
>  
> {code:java}
> // lines 202 ff.
> if (log.isDebugEnabled()) {
>     log.info("flush({}) failed ({}) to wait for space of len={}: {}: ", this, 
> e.getClass().getSimpleName(), total, e.getMessage(), e); // with stacktrace
> } else {
>     log.info("flush({}) failed ({}) to wait for space of len={}: {}",
>  this, e.getClass().getSimpleName(), total, e.getMessage());
> }
> throw e;
> {code}
> Thanks,
> Markus
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to