tags:

views:

268

answers:

4

Is it possible to subscribe to a url with log4j logs? I understand that many applications do have daily error logs notification by email. But a problem with this approach is that the server that host the application may not provide smtp capability. Thus the RSS subscribe approach seens to be more flexibile.

Anyone know how is this being done ?

+1  A: 

A pretty simple solution would be to use log4j (or log4net in my case) to persist the logging information to some store (database or file). Then you can easily create a service that exposes that log as an RSS feed.

Torbjørn
+1  A: 

Simplest thing to do would be to write a custom Log4J appender (not hard, just subclass WriterAppender) which converts LoggingEvents into RSS format, and stores them in a disk file. Each time it gets a new event, load in the existing file, parse it, add the new RSS entry, and write it back. Then use a web server to server up the RSS.

It won't scale well, but then if you have large numbers of log events, then RSS itself is not a good choice.

skaffman
A: 

very nice

+3  A: 

A log4j RSS appender has already been written. Have a look at http://code.google.com/p/rssappender/

labratmatt