2 Replies Latest reply: Jun 2, 2007 4:07 PM by 807606 RSS

    Log4j and commons logging

    807606
      Hi,
      My application is using log4j, I get my logger as follows:
      private static Logger sLogger = Logger.getLogger(Neolyser.class);
      My problem is that Im using a library thats using commons logging and writes all its logging onto my logger, which I dont want. I want only to see my log statements, I'm happy enough with exceptions and stack traces from the library. So how can I turn off the commons logging? Or at least get it to write to another logger? Thanks in advance,
      Ste
        • 1. Re: Log4j and commons logging
          DrClap
          Change your log4j configuration so it causes the logging for that library to be written somewhere else (or not written at all).
          • 2. Re: Log4j and commons logging
            807606
            Hi thanks for your reply, Im pretty new to log4j so I dont know how to do that. I configure my looger as follows:
            BasicConfigurator.resetConfiguration();
            ConsoleAppender lCAppender = new ConsoleAppender(new PatternLayout(lPattern));
            lCAppender.setThreshold(Level.toLevel(lLevel));
            Are there other settings I can use to turn off the library logging? Thanks