我正在使用我自己的启动脚本启动一个 Cassandra 实例,该脚本设置 CASSANDRA_CONF 目录(位于 CASSANDRA_HOME 目录之外)。
export CASSANDRA_CONF=/path/to/conf
cassandra -f -Dcassandra.config=file://path/to/yaml
当该过程开始时,我注意到日志不尊重我的 log4j-server.properties 文件。经过进一步调查,似乎 log4j-server.properties 文件没有被拾取,即使对它的引用出现在 Cassandra 生成的命令行参数中:
-Dlog4j.configuration=log4j-server.properties
在脚本中,我输出了 log4j-server.properties 文件的内容,以确保它至少是从正确的位置读取的,并且确实如此。我是否缺少一些配置选项使 Cassandra 从 log4j-server.properties 文件中读取?