0 Replies Latest reply on Oct 29, 2013 8:54 AM by Anish Antony

    Configure two logger in one application using log4j

    Anish Antony Newbie

      I created an aribaweb application which is running on JBoss AS7. In JBoss AS7 uses org.jboss.logmanager.log4j.BridgeLogger class for Logger implementation (Here the BridgeLogger class extends with org.apache.log4j.Logger). I deployed an aribaweb application in JBoss AS7 server . Internally aribaweb application also uses same Log4J Implementation for logging purpose but it uses ariba.util.log.Logger class (Here the ariba Logger class extends with org.apache.log4j.Logger) for Logger implementation. But aribaweb application shows no result due to some class cast exception which is related to logger issue here follows few lines of my exception

       

      java.lang.ExceptionInInitializerError
        at ariba.util.core.ClassUtil.classForName(ClassUtil.java:259)
        at ariba.util.core.ClassUtil.classForName(ClassUtil.java:182)
        at ariba.ui.aribaweb.util.AWClassLoader.getClass(AWClassLoader.java:49)
        at ariba.ui.aribaweb.util.AWUtil.classForName(AWUtil.java:201)
        at ariba.ui.aribaweb.core.AWConcreteApplication.createApplication(AWConcreteApplication.java:145)
        at ariba.ui.servletadaptor.MyAWDispatcherServlet.createApplication(RimsAWDispatcherServlet.java:25)
        at ariba.ui.servletadaptor.AWDispatcherServlet.init(AWDispatcherServlet.java:54)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]
        ... 246 more
      Caused by: java.lang.ClassCastException: org.jboss.logmanager.log4j.BridgeLogger cannot be cast to ariba.util.log.Logger
        at ariba.util.log.Log.(Log.java:90)

      The exception happening on ariba.util.log.Log.java class with following lines

      public static final Logger startup =
        (Logger)Logger.getLogger("startup");


      I dont know about JBoss logging configuration. Is there is any logger in JBoss AS7 which have same name as "startup"?. or is there is any configuration to solving this?