Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

Write custom appenders for log4j

Extend log4j to support lightweight over-the-network logging

  • Print
  • Feedback

Page 6 of 6

In general, you can use custom appenders in many interesting ways. For example, your appender could put the log messages into a database so you can search them using SQL. You can distribute the messages to a directory (either LDAP or files) to make it easier to separate critical messages from noncritical ones. You could even write appenders to send people pages or SMS (short message service) messages when something goes really wrong with the system (though the built-in SMTP appender might be able to do that as well). Appenders make an already powerful system even more powerful.

About the author

Allen Holub has worked in the computer industry since 1979 on everything from operating systems, to compilers, to Web applications. He is a consultant, providing mentoring and training in object-oriented design and Java development, technical due diligence, design reviews, and he writes programs on occasion. He served as a chief technology officer at NetReliance and sits on the board of advisors for Ascenium and Ontometrics. Allen has authored nine books (including Holub on Patterns: Learning Design Patterns by Looking at Code, Taming Java Threads, and Compiler Design in C) and more than 100 magazine articles. Allen has been a contributing editor for JavaWorld since 1998 and for SD Times since 2004.
  • Print
  • Feedback

Resources