Steve, Tomorrow I'll post an example properties file to do what I'm talking about.
Should be easy to create an "Overwriting Appender" (from FileAppender), but that's not a good solution. Use a RollingFileAppender with a small limit and small number of backups or some such. I'll go into this more tomorrow. Kevin Steve Cohen wrote: > Thanks, Kevin. > I'm new at log4j so please excuse these questions about your answer. With the >special category, would these messages filter into the regular logs or not? Or would >regular log messages filter into the heartbeat log? I thought the way it worked was >that only messages above a certain level made it into any log. So one way or the >other, it would seem that unwanted messages would get into some log. Or does a >special category live outside the normal hierarchy? > > I'm also not entirely comfortable with the notion of preserving past heartbeats in >the heartbeat log. Maybe I'm just not used to it. How difficult would it be to >subclass Appender to create an "Overwriting 'Appender'"? > > > > -----Original Message----- > From: Kevin Steppe [mailto:[EMAIL PROTECTED]] > Sent: Tue 4/30/2002 7:03 PM > To: Log4J Users List > Cc: > Subject: Re: Heartbeat Logging? > > 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]> > > > > > ------------------------------------------------------------------------ > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > winmail.dat > > Content-Type: > > application/ms-tnef > Content-Encoding: > > base64 > > > ------------------------------------------------------------------------ > attachment.txt > > Content-Type: > > text/plain > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>