Consider moving from log4j and using the logback implementation of the slf4j API. The log has an extensive list of appenders .
I think that perhaps your questions are more about how to make your magazines searchable. The answer depends on what you are looking for.
- For simple applications, I just use the copied appender and grep file for the messages that interest me.
- More complex applications will additionally register messages in the database.
- There are currently no Solr applications available for log4j and logback. However, it is easy to write using the solrj API
- For monitoring log messages, there is lilith , which is the remote GUI for log messages. I don’t know how well it scales, but it is certainly interesting for demonstrations and simple monitoring.
Update
As suggested by Sebastien, there is also a Graylog2 appender for the magazine. Now available at Maven Central
<dependency> <groupId>me.moocar</groupId> <artifactId>logback-gelf</artifactId> <version>0.9.6p2</version> </dependency>
Of course, this will depend on the installation of the graylog2 server.
source share