开发者

Couchdb and log4j

开发者 https://www.devze.com 2023-03-14 22:59 出处:网络
So I am thinking about making the change to couchdb. I googled it but couldn\'t find any documentation that it would support 开发者_运维百科log4j. What I am trying to do is have a logger send logs to

So I am thinking about making the change to couchdb. I googled it but couldn't find any documentation that it would support 开发者_运维百科log4j. What I am trying to do is have a logger send logs to a database and have it store it. From there I want to be able to retrieve the logs and display it. Does couchdb support this?


First off you need to learn about couchapp and install CouchLog.

Second you will have to write your own log4j appender to send the log entries in the format that CouchLog expects.

I hacked together a log4j appender that did this a long time ago, the code is lost, don't ask for it. But it was only like 30 mins of coding to get it working.


There is a NoSQL appender that supports currently CouchDB and MongoDB:

NoSQLAppender The NoSQLAppender writes log events to a NoSQL database using an internal lightweight provider interface. Provider implementations currently exist for MongoDB and Apache CouchDB, and writing a custom provider is quite simple. (source: https://logging.apache.org/log4j/2.x/manual/appenders.html)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号