Cassandra not picking up log4j-server.properties file -
i starting cassandra instance own start script sets cassandra_conf directory (which outside of cassandra_home directory).
export cassandra_conf=/path/to/conf cassandra -f -dcassandra.config=file://path/to/yaml
when process begins, noticed logs not respecting log4j-server.properties file. after further investigation, seems though log4j-server.properties file not being picked though reference appears in command line arguments generated cassandra:
-dlog4j.configuration=log4j-server.properties
in script, output contents of log4j-server.properties file make sure @ least reading right place , was. there configuration option i'm missing makes cassandra read log4j-server.properties file?
which version running? if you're running 2.1+ (which not stable build), there has been switch log4j logback, , old configuration files no longer affect anything.
logback configured through xml files, , argument you'd have use -dlogback.configurationfile=logback.xml
more details switch here.
here example config checked in.
<configuration scan="true"> <appender name="file" class="ch.qos.logback.core.rolling.rollingfileappender"> <file>/var/log/cassandra/system.log</file> <rollingpolicy class="ch.qos.logback.core.rolling.fixedwindowrollingpolicy"> <filenamepattern>/var/log/cassandra/system.log.%i.zip</filenamepattern> <minindex>1</minindex> <maxindex>20</maxindex> </rollingpolicy> <triggeringpolicy class="ch.qos.logback.core.rolling.sizebasedtriggeringpolicy"> <maxfilesize>20mb</maxfilesize> </triggeringpolicy> <encoder> <pattern>%-5level [%thread] %date{iso8601} %f:%l - %msg%n</pattern> <!-- old-style log format <pattern>%5level [%thread] %date{iso8601} %f (line %l) %msg%n</pattern> --> </encoder> </appender> <appender name="stdout" class="ch.qos.logback.core.consoleappender"> <encoder> <pattern>%-5level %date{hh:mm:ss,sss} %msg%n</pattern> </encoder> </appender> <root level="info"> <appender-ref ref="file" /> <appender-ref ref="stdout" /> </root> <logger name="com.thinkaurelius.thrift" level="error"/> </configuration>
Comments
Post a Comment