RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Track Your Apps with the Open Source Logging Framework, Log4j

As many developers can attest, logging is one of the most accessible ways to monitor the health and performance of your Java applications. Find out how Log4j, a logging framework from Apache, can handle both simple and advanced (multi-app, multi-machine) logging scenarios.

hey say 'necessity is the mother of invention.' Being able to keep an eye on your application is a need from which emerged logging and tracing frameworks. Application developers needed a way to have their programs relay vital signs and other signs of life to them. Many developers tend to use log statements as a low-tech approach to debugging. Such an approach is often leveraged in production, when you might not have the luxury of using your IDE's debugger against your production code. Also, when things go wrong, you can trace the root of a problem using persisted logs.

Log4j is an open source logging API for Java, designed to be "reliable, fast, and extensible." To the avail of programmers wanting to adopt an easy logging facility, Apache Log4j fits the mold.

Some Log4j Terminology
In the Log4j world:

  • Loggers are the workhorses for logging messages.
  • Appenders are associated to loggers and determine where log messages are reported.
  • Layouts define what your log messages will look like.

What You Need
At the time of this article's writing, Log4j was in version 1.2.8. You can download the latest Log4j version from: http://logging.apache.org/log4j/docs/download.html.

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date