Michaël Figuière created CASSANDRA-5877:
-------------------------------------------

             Summary: Unclear FileNotFoundException stacktrace when system.log 
can't be created
                 Key: CASSANDRA-5877
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5877
             Project: Cassandra
          Issue Type: Bug
         Environment: Cassandra 2.0rc1
            Reporter: Michaël Figuière
            Priority: Trivial


When you start Cassandra with default settings without the appropriate 
permissions to write in {{/var/log/cassandra}} you end up with the following 
stacktrace:

{code}
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /var/log/cassandra/system.log (No such file or 
directory)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:127)
        at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
        at 
org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
        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:395)
        at 
org.apache.log4j.PropertyWatchdog.doOnChange(PropertyConfigurator.java:922)
        at 
org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:89)
        at org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:58)
        at 
org.apache.log4j.PropertyWatchdog.<init>(PropertyConfigurator.java:914)
        at 
org.apache.log4j.PropertyConfigurator.configureAndWatch(PropertyConfigurator.java:461)
        at 
org.apache.cassandra.service.CassandraDaemon.initLog4j(CassandraDaemon.java:121)
        at 
org.apache.cassandra.service.CassandraDaemon.<clinit>(CassandraDaemon.java:69)
{code}

While a stacktrace at startup may not be the most elegant mean of communication 
with the user - though at least it's visible - in this situation it doesn't 
make it clear that Cassandra couldn't create a file in the specified log 
directory.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to