7 Replies Latest reply on Jan 31, 2013 11:59 AM by James Perkins

    How slf4j-jboss works ?

    yunshi tan Newbie



      I have a very wired question : How slf4j-jboss works ? I spent one whole day trying to figure it out ...


      I have projects using the libs like


      • application -> log4j-over-slf4j -> slf4j-api -> slf4j-jboss-logmanager -> jboss-logmanager
      • application -> jcl-over-slf4j     -> slf4j-api -> slf4j-jboss-logmanager -> jboss-logmanager
      • application -> slf4j-api -> slf4j-jboss-logmanager -> jboss-logmanager


      Here comes the problem:


      I simplely want to add one line in Slf4jLogger.java of slf4j-jboss-logmanager to filter out '\n' chars in the logging message, but I cannot get what I want because the functions like logger.isInfoEnable(), logger.info(), logger.trace() etc are never called !


      However, I add some trace in the construction of Slf4jLogger.java to make sure that getLogger construct an Slf4jLogger. Then I emtpy all the logger.info, logger.trace, logger.debug functions in Slf4jLogger.java. When I restart jboss, logs are print out as usual while the trace in the construction of Slf4jLogger.java! tells me that I am using slf4j.


      As I understand, Slf4jLogger.java of slf4j-jboss-logmanager implements slf4j-api to delegate the logging job to jboss-logmanager. But this does not happen in my jboss7...


      Does anyone have some ideas about this plz ?


      PS. I use jboss 7.1.1.final.