David Bejar
David Bejar

Reputation: 522

mule service start script raises exception with log file

I'm trying to rewrite the mule start script so it works as a service on a RHEL.

Currently I have it mostly done. It is starting and I have the most of the log files being successfully written where I want them. But there's a file named literally .log that I do not know what is for, neither where to configure (its name and path).

Such file is adding the following nasty lines in the mule_ee.log upon start up:

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: .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:294)
    at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
    at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:809)
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)
    at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:547)
    at org.mule.module.launcher.log4j.ApplicationAwareRepositorySelector.configureFrom(ApplicationAwareRepositorySelector.java:166)
    at org.mule.module.launcher.log4j.ApplicationAwareRepositorySelector.getLoggerRepository(ApplicationAwareRepositorySelector.java:95)
    at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:208)
    at org.apache.log4j.LogManager.getLogger(LogManager.java:228)
    at org.mule.module.logging.MuleLoggerFactory.getLogger(MuleLoggerFactory.java:77)
    at org.mule.module.logging.DispatchingLogger.getLogger(DispatchingLogger.java:419)
    at org.mule.module.logging.DispatchingLogger.isInfoEnabled(DispatchingLogger.java:191)
    at org.apache.commons.logging.impl.SLF4JLog.isInfoEnabled(SLF4JLog.java:78)
    at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:188)
    at org.mule.module.launcher.application.PriviledgedMuleApplication.init(PriviledgedMuleApplication.java:46)
    at org.mule.module.launcher.application.ApplicationWrapper.init(ApplicationWrapper.java:64)
    at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:46)
    at org.mule.module.launcher.DeploymentService.guardedDeploy(DeploymentService.java:398)
    at org.mule.module.launcher.DeploymentService.start(DeploymentService.java:181)
    at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:157)
    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.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:56)
    at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:3925)`

What is that .log file for? Where is the conf file to set it up to be written in a place where the mule user has permissions to write?

Upvotes: 0

Views: 1317

Answers (2)

David Bejar
David Bejar

Reputation: 522

The .log file seems to be from the 00_mmc-agent app.

The problem therefore was in the log4j.properties file located in ./apps/00_mmc-agent/classes such file has the following appender configured: log4j.appender.file.File=${app.name}.log That ${app.name} variable seem to be not properly configured (not even in the default not modified mule starting script). hence the .log file name.

In ./apps/mmc/webapps/mmc/WEB-INF/classes/log4j.properties the appender is configured like this log4j.appender.R.File=${mule.home}/logs/mmc-console-app.log

So, to fix the startup error I modified the appender of the log4j.properties file located in ./apps/00_mmc-agent/classes to have this path:

log4j.appender.file.File=${mule.home}/logs/00_mmc-agent.log

Upvotes: 0

Ale Sequeira
Ale Sequeira

Reputation: 2039

It seems that log4j can't find that file because OS permissions. You can chmod to add permissions in your MULE_HOME dir. And also review your log4j config to see why is trying to read .log file.

Upvotes: 2

Related Questions