Hi Ralph, Thank you very much for the explanation. One more question, If I use the Commons Logging Bridge in OSGi environment do i need to include following resource org.apache.commons.logging.LogFactory to the META-INF/services directory of the OSGi bundle?
Thanks, Chathura. On Thu, Apr 23, 2015 at 5:38 PM, Ralph Goers <[email protected]> wrote: > 1. That message comes from log4j 1.x so you still have its jar in the > class path. > 2. The Commons Logging bridge is not meant for you to code against. You > should be coding t the commons logging API. The bridge then binds commons > logging to log4j 2. > > Sent from my iPad > > On Apr 23, 2015, at 2:36 AM, Chathura Priyankara <[email protected]> > wrote: > > Hi, > > I want to use log4j2 Commons Logging Bridge with commons 1.2. I tried to > use something like follows: > > import org.apache.logging.log4j.jcl.LogFactoryImpl; > public class MyClass{ > > private static Log log = > LogFactoryImpl.getLog(DropinsBundleDeployer.class); > . > . > . > log.error("Error occured", e);} > > But when I'm running the code I'm getting following issue and cannot see > any log: > > log4j:WARN Please initialize the log4j system properly. > > However the log4j2.xml file is in the class path. > How can I correctly use commons logging 1.2 with log4j2 ? > Thanks! > Chathura. > > -- > Chathura Priyankara, > Faculty of Information Technology, > University of Moratuwa. > Blog : www.codeoncloud.blogspot.com > > -- Chathura Priyankara, Faculty of Information Technology, University of Moratuwa. Blog : www.codeoncloud.blogspot.com
