← Back to team overview

dhis2-devs team mailing list archive

Re: Audit log error with Tomcat

 

This audiot stuff is not very good since it will put the log file at the
location where you start the servlet container. So I am guessing you start
tomcat from a location where the process doesn't have write privilegies and
then dhis fails when trying to create the file...?

On Thu, Feb 24, 2011 at 6:20 PM, Jason Pickering <
jason.p.pickering@xxxxxxxxx> wrote:

> Can someone please explain how I can prevent this error from happening?
>
> Straight up setup of DHIS2 on Ubuntu.
>
> INFO: Deploying web application archive dhis.war
> log4j:ERROR setFile(null,true) call failed.
> java.io.FileNotFoundException: audit.log (Permission denied)
>        at java.io.FileOutputStream.openAppend(Native Method)
>        at java.io.FileOutputStream.<init>(FileOutputStream.java:207)
>        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
>        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.parseCatsAndRenderers(PropertyConfigurator.java:533)
>        at
> org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:417)
>        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:283)
>        at
> org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:108)
>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>        at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>        at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
>        at
> org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1040)
>        at
> org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:838)
>        at
> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
>        at
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
>        at
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
>        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
>        at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
>        at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
>        at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
>        at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
>        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:526)
>        at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
>        at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
>        at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
>        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:722)
>        at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>        at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>        at
> org.apache.catalina.core.StandardService.start(StandardService.java:516)
>        at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>        at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:616)
>        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
>        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
> log4j:ERROR Either File or DatePattern options are not set for appender
> [AUDIT].
> * INFO  17:08:38,576 System property dhis2.home not set
> (DefaultLocationManager.java [main])
> * INFO  17:08:38,581 Environment variable DHIS2_HOME points to
> /var/lib/tomcat6/conf/dhis2 (DefaultLocationManager.java [main])
>
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx
> tel:+260974901293
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>

References