hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Calabrese <m...@jasoncalabrese.com>
Subject Re: question about Log4j Configuration
Date Fri, 18 Aug 2006 16:59:54 GMT
I think it would be good to remove the log4j.properties file from the 
hadoop.jar.  Since it's in the jar now it is picked up by 
log4j/commons-logging.

I think it would be better to just add it to the classpath in the scripts.

In my application we are using Hadoop and parts of Nutch, but have our own 
log4j.xml file that gets loaded during application startup after we locate 
the path from some other configuration files.

Since log4j finds the hadoop log4j.properties file first we get some annoying 
errors in our catalina.out such as:
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: / (Is a directory)
        at java.io.FileOutputStream.openAppend(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
        at org.apache.log4j.FileAppender.setFile(FileAppender.java:289)
        at 
org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163)
        at 
org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:215)
        at 
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
        at 
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132)
        at 
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96)
        at 
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:654)
        at 
org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
        at 
org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
        at 
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
        at 
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441)
        at 
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468)
        at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
        at org.apache.log4j.Logger.getLogger(Logger.java:104)
        at 
org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
        at 
org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
        at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370)
        at 
org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:380)
        at 
org.apache.catalina.valves.ValveBase.createObjectName(ValveBase.java:242)
        at 
org.apache.catalina.core.StandardPipeline.registerValve(StandardPipeline.java:296)
        at 
org.apache.catalina.core.StandardPipeline.start(StandardPipeline.java:233)
        at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4045)
        at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at 
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:788)
        at 
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:677)
        at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)
        at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
        at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
        at 
org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
log4j:ERROR Either File or DatePattern options are not set for appender 
[DRFA].


On Tuesday 15 August 2006 11:43 am, Doug Cutting wrote:
> Hadoop uses Commons Logging:
>
> http://jakarta.apache.org/commons/logging/
>
> One should be able to configure it to use other logging backends or a
> null logger:
>
> http://jakarta.apache.org/commons/logging/commons-logging-1.1/guide.html#Co
>nfiguration
>
> Please tell us how this works.
>
> Doug
>
> Dilma DaSilva wrote:
> > Hello,
> >
> > We're trying to experiment with Hadoop running in a restricted
> > java environment. Is there a way of bypassing logging entirely so that
> > a log4j jar is not needed?
> >
> > Thanks,
> >
> > Dilma
> > -----------------------------------------------------
> > Dilma M da Silva
> > Advanced Operating Systems Group
> > IBM Watson Research Center
> > 1101 Kitchawan Rd, Route 134
> > Yorktown Heights, NY 10598
> > USA
> > Phone: 1-914-945-3715
> > dilmasilva@us.ibm.com ou dilma@watson.ibm.com

Mime
View raw message