3 Replies Latest reply on Jan 4, 2011 6:26 PM by peterj

    help with log4j suppressing STDERR

    vamage

      I need to surpress application STDERR messages from going to the root log. I wish to send them some where else because they are near useless when multible errors occur at the same time making server.log hard to read and that certain service log error messages here.  I haven't been able to find any useful documentation. most documentation tells me to disable root logging for that bad application and that is not an option.

      Thanks!

        • 1. Re: help with log4j suppressing STDERR
          mpokorny

          I could be way way off - but why not simply increase the logging level for the right classes so the message you dont want to appear are ignored ?

          • 2. Re: help with log4j suppressing STDERR
            peterj

            Unfortunately there is no class associated with STDERR so as far as I can tell there is no way to configure log4j to not print out STDERR (or STDOUT) messages. Of course, someone could always prove me wrong. Or you could dig through the log4j source code and see if and how it could be done (that it the beauty of open source, after all), and then post thge solution here.

            • 3. Re: help with log4j suppressing STDERR
              peterj

              Actually, thinking about it again, try adding this to the log4j config file to turn it off (or add an appender-ref to rediect it to a specific appender):

               

              <category name="STDERR">
                  <priority value="OFF"/>
              </category>