2012-12-28 22 views
1

我試圖從Java應用程序中將log4j日誌插入到Cassandra中。我從http://www.datastax.com/docs/datastax_enterprise2.0/logging/log4j_logging獲得了log4j屬性的配置。如何將log4j日誌插入到cassandra中

我無法獲得com.datastax.logging.appender.CassandraAppender。任何人都可以讓我知道從哪裏獲得Cassandra appender,或者有什麼方法可以整合log4j和Cassandra?

+0

Log4j已經集成了cassandra.You只需要在類路徑中包含所有相關jar,並在運行程序時提供日誌配置文件的路徑。 – samarth

回答

0

log4j appender是DataStax Enterprise的一部分;它本身不包含在Apache Cassandra中。如果您已經在使用DataStax Enterprise,請確保您已將path/to/dse/resources/log4j-appender/lib/添加到您的應用程序的類路徑中。

+0

嗨..我不使用datastax企業,因爲它是試用版..我已經下載apache cassandra 1.1.2版本..用於登錄log4j登錄到cassandra即時通訊使用rviper/cassandra-log4j·GitHub項目,我得到以下錯誤..「log4j:錯誤Log4jAppender,org.apache.thrift.protocol.TProtocolException:在序列化數據中未找到必需字段'replication_factor'!」你可以讓我知道我在做什麼 – user1537462

+0

@ user1537462如果你使用不同的圖書館並有問題,我建議爲它開個新的問題。通過評論調試問題太困難了。 –