Steve,
   I would set up a special catagory/logger for heartbeats 
("myapp.heartbeat.x", "myapp.heartbeat.y", ...).  Attach a FileAppender 
to that category which will output the date-time of the logging.  Then 
watch the lastModified() date on that file.  The lastModified will 
change with every logging, AND you have a record of all the heartbeats 
which can be valuable.  Then you can also seperate out different 
heartbeat categories at deploy or run time by changing the config.

Kevin


Steve Cohen wrote:

> A cursory glance at the documentation doesn't reveal support for heartbeat logging 
>within Log4j.  
> 
> In my company's previous work, we used a roll-your-own logging approach that enabled 
>this, in a way that might be considered kludgey.  Every logging message participating 
>in this scheme would write its most recent logging message into a heartbeat file 
>OVERWRITING its previous contents.  Monitoring applications could simply look at this 
>file's date, and if necessary, the contents of the last message.  In Log4j terms, it 
>might best be thought of as an Overwriting "Appender"; in "C" terms the file was 
>opened with "w" instead of "a".
> 
> Now, I don't know that we want to continue in this vein, because I realize that it 
>is a kludge, as I indicated, but then the question becomes, how best to implement 
>heartbeat logging using Log4j?
> 
> -----------------------------------------------------------------
> Steve Cohen
> Sr. Software Engineer
> Ignite Sports, Inc.
> [EMAIL PROTECTED]
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to