1 Reply Latest reply on Sep 14, 2002 4:34 PM by marc fleury

    Logging line by line

    Tim Fox Master

      I couldn't find a forum for "general" matters, so this seemed most appropriate - excuse me if it's not.

      Basically, JBoss seems to be logging exceptions line by line in some circumstances. As far as I can tell it does this when the string to be logged contains carriage returns.

      It APPEARS to be calling the log4j logging methods for EVERY LINE of a stack trace instead of once for the whole stacktrace, or that's the cosmetic effect anyway.

      This would be only mildly annoying if it was just logging to a file, but I'm using the SMTP appender, so I get an error email for every line of the message (OUCH!).

      So for a typical 100 line JBoss stack trace, i get 100 emails.

      Looking through the code, I found this comment in org.jboss.logging.util.CategoryStream.java:

      // HACK, something is logging exceptions line by line (including
      // blanks), but I can't seem to find it, so for now just ignore
      // empty lines... they aren't very useful.

      So I guess this is an outstanding bug.

      Does anyone know of a workaround/solution?

      I guess this could be a log4j bug, but I successfully use log4j to log multi-line strings, in other situations without problems, so I doubt it.

      Any help would be gratefully appreciated.


        • 1. Re: Logging line by line
          marc fleury Master

          This is strange indeed. Since essentially we do not do anything but use log4j I don't see what is going on. All I can recommend is that you dive in this and try to understand the problem a bit better, this is a bit too 'high-level' for someone to work on it (but you :)