你好,我正在尝试使用hector将Java Maven应用程序连接到Cassandra。代码非常简单
进口......
public class App {
public static void main( String[] args ){
Cluster cluster = HFactory.getOrCreateCluster("TestCluster",
new CassandraHostConfigurator("localhost:9042"));
}
}
}当我运行它时,我有以下异常:
log4j:WARN No appenders could be found for logger (me.prettyprint.cassandra.connection.CassandraHostRetryService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.我想我需要设置一些东西,但是我找不到它是什么。
发布于 2015-06-24 22:52:25
您需要一个log4j属性文件。从Hector docs
使用以下参数运行您的应用程序:
-Dlog4j.configuration=file:///path/to/log4j.properties其中,log4j.properties包含:
log4j.rootLogger=DEBUG,stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.SimpleLayoutLog4J非常强大,有关更多信息,请查看project site。
https://stackoverflow.com/questions/31029688
复制相似问题