[ 
https://issues.apache.org/jira/browse/CASSANDRA-2611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135461#comment-13135461
 ] 

David Allsopp commented on CASSANDRA-2611:
------------------------------------------

Seems to behave as expected on trunk, i.e. log output is the same before and 
after the change. I was initially concerned that the logger in CassandraDaemon 
is created statically (i.e. before initLog4j is called) but this doesn't seem 
to be an issue. None of the static methods in CassandraDaemon does any logging 
before the constructor is called, so the logger should be configured by the 
time anything calls it.

Note that if log4j.defaultInitOverride is undefined or false, initLog4j() 
doesn't actually do anything, so you could configure logging as you please or 
use the default log4j behaviour, in embedded usage.
                
> static block in AbstractCassandraDaemon makes it difficult to change log4j 
> behavoiur
> ------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2611
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2611
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 0.7.4, 0.7.5, 1.0.0
>         Environment: Windows 7
>            Reporter: Paul Loy
>            Assignee: Tommy Tynjä
>            Priority: Minor
>              Labels: daemon, initialisation, log4j
>         Attachments: CASSANDRA-2611-test.patch, CASSANDRA-2611.patch
>
>
> We embed Cassandra in our application - mainly because our webservices are 
> such a thin layer on top of Cassandra that it really does not make sense for 
> us to have Cassandra in an external JVM. In 0.7.0 this was all fine. Now 
> upgrading to 0.7.5, there is a static block in AbstractCassandraDaemon. This 
> gets called when the class is loaded causing us issues as we have not 
> generated the log4j.properties file at this point in time.
> Can this not be a protected method that is called when 
> AbstractCassandraDaemon is constructed? That way a) I can control the 
> behaviour and b) my log4j.properties file will have been generated by then.
> Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to