You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2015/08/03 13:52:04 UTC

[jira] [Updated] (SLING-4921) SlingMainServlet logs IOException at debug level only

     [ https://issues.apache.org/jira/browse/SLING-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertrand Delacretaz updated SLING-4921:
---------------------------------------
    Attachment: SLING-4921.patch

Robert suggested looking at how Tomcat generates the ClientAbortException that it uses to identify client disconnects - turns out that that exception is generated when an output buffer is written or flushed to the client.

The attached SLING-4921.patch uses the same technique where the RequestLoggerFilter's RequestLoggerResponse.LoggerResponseOutputStream class wraps IOExceptions in ClientAbortException when writing to the client.

Using my test client [1] to generate lots of disconnects, with this patch I get the correct ClientAbortException at the debug level in the logs, and other IOException are now reported like any other exceptions.

This will only work if the RequestLoggerFilter is used, and we might want to implement the same technique in other places where we write to the client - I'll ask for feedback on our dev list.

[1] https://svn.apache.org/repos/asf/sling/whiteboard/bdelacretaz/http-disconnect-test - run with "java -jar target/org.apache.sling.bdelacretaz.http.disconnect-0.1.1-SNAPSHOT.jar  10000 0.01 localhost 8080 /index.html"


> SlingMainServlet logs IOException at debug level only
> -----------------------------------------------------
>
>                 Key: SLING-4921
>                 URL: https://issues.apache.org/jira/browse/SLING-4921
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: Engine 2.4.2
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: SLING-4921.patch
>
>
> The log level of IOException was reduced to DEBUG for SLING-3498, to avoid polluting the logs with client disconnect exceptions, which are hard to identify reliably.
> The downside is that this hides legit IOException from application code, as debug logs are usually not enabled on production systems.
> We should find a better to way to separate client disconnects from application-level IOException, and log the latter in the usual way.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)