Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Serverside logging of Tomcat ClientAbortException (java.io.IOException)

    Hi Isomorphic,

    we currently have the problem that our logs are getting cluttered with ERRORS of org.apache.catalina.connector.ClientAbortException (extends java.io.IOException) logged by you (v12.0p_2020-05-03).
    These exceptions aren't really bad things where we could or want to do something about (e.g. a user closed a browser window), but we can't ignore them because we can't target them explicitly in our log4j2 config.

    It looks like this:
    Click image for larger version

Name:	LogMessage.png
Views:	790
Size:	60.6 KB
ID:	262690

    The message itself gets logged in BaseFilter.handleError(HttpServletResponse response, String errorMessage, Throwable t).
    While I think it is correct that it gets logged the problem here is that to us all these messages look the same - they just say "BaseServlet Global Exception" with no mention of the root cause ("java.io.IOException: Connection reset by peer").
    So in our log4j config we can only ignore all CompressionFilter-logs completely (via log4j-RegexFilter) or have them all, as the message "BaseServlet Global Exception" is always the same.

    My question is now if you could either:
    • Don't log but rethrow the exception (most likely a big change you don't want to do)
    • Amend the text "BaseServlet Global Exception" with some text from the Throwable t - e.g. "java.io.IOException: Connection reset by peer" or whatever the exception message is.

    Click image for larger version

Name:	LogMessage2.png
Views:	841
Size:	69.8 KB
ID:	262691

    Thank you & Best regards
    Blama



    #2
    Our code (that you highlighted) is passing the underlying exception object to the log system and you're getting a full stack trace from it. Are you unable to configure your log system to do something based on this exception?

    If that's the case, what are you suggesting:

    1. redundantly log the exception message, even though it's already logged?

    2. log this kind of "ordinary" exception in a special category? Not really feasible - different servlet engines throw different classes

    Comment

    Working...
    X