[opencms-dev] problem with log4j - opencms_init.log

eelboy at aol.com eelboy at aol.com
Thu Dec 9 16:56:02 CET 2010


I am new to OpenCms, so take my post lightly :)  Running my tomcat as 
ROOT webapp (as well as root user):

It seemed to me that this file (opencms_init.log) was being placed in 
whatever
directory I was in at the time that I started tomcat.  I have never seen 
any data in this file (always size 0). I finally
decided that I would rather not have them sprayed around my file system 
so I went into the log4j.properties and
made this change:

opencms.set.logfile=true
opencms.logfile=${catalina.base}/logs/opencms_init.log

What I expected then was to see this file in the tomcat logs directory.  
But, to my surprise , it simply doesn't
get created anymore.  I don't get any errors in any other log files 
though, so that was good enough for me.
I would love to know what the developers intended to write to this 
file.  (The remaining configuration in
the log4j.properties seems to work fine and is logging normally to the 
file that I have specified).

Hope this helps,
eelboy


On 12/9/2010 10:40 AM, Christoph P. Kukulies wrote:
> I'm resurrecting a site which runs under Debian (squeeze) and after
> having tamed tomcat6 and had filled ~/webapps/ROOT (running opencms as
> the ROOT app with the rewrite rules and http-proxies) again from the
> backup, I'm seeing some ERROR message in catalina.out.
>
> I also have log4j enabled, for what it's worth. Maybe it has got to do with
> it. I wonder what's triggering opencms_init.log since I only found
> it randomly in some places and there doesn't seem to be any pattern where
> it should be located.
>
> The permission problem could stem from the fact that tomcat is running under
> user tomcat6 and it might be it wants to read or write a file w/o permissions.
>
>
> log4j.properties: -------------------------------------
>
>
> log4j.rootLogger=DEBUG, R
>              log4j.appender.R=org.apache.log4j.RollingFileAppender
>              log4j.appender.R.File=${catalina.home}/logs/tomcat.log
>              log4j.appender.R.MaxFileSize=10MB
>              log4j.appender.R.MaxBackupIndex=10
>              log4j.appender.R.layout=org.apache.log4j.PatternLayout
>              log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
>
>
> catalina.out: -----------------------------------------
>
> INFO: Deploying web application directory ROOT
> log4j:ERROR setFile(null,true) call failed.
> java.io.FileNotFoundException: opencms_init.log (Permission denied)
>      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:290)
>      at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:194)
>      at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:164)
>      at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
>      at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:133)
>      at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
>      at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)
>      at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
>      at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544)
>      at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440)
>      at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)
>      at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
>      at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
>      at org.apache.log4j.Logger.getLogger(Logger.java:105)
>      at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:289)
>      at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:109)
>      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:513)
>      at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1116)
>      at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:914)
>      at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604)
>      at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)
>      at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:704)
>      at org.opencms.main.CmsLog.<clinit>(CmsLog.java:76)
>      at org.opencms.main.OpenCmsListener.<clinit>(OpenCmsListener.java:60)
>      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:513)
>      at java.lang.Class.newInstance0(Class.java:355)
>      at java.lang.Class.newInstance(Class.java:308)
>      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4079)
>      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
>      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
>      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
>      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
>      at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
>      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
>      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
>      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
>      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>      at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
>      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
>      at org.apache.catalina.core.StandardService.start(StandardService.java:519)
>      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>      at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
>      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:597)
>      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
>      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
>
>
> --
> Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list