Formatting JDK 1.4 Logging Information

Samudra Gupta · Apress eBooks · 2003

The goal of the JDK 1.4 logging API is to provide a way to encapsulate logging information at the appropriate level of detail. In the previous chapter, we explored various objects that are utilized to capture logging information, how to tell the logging API the detail level of the logging activity that should be performed, and also how to change and pass different configuration parameters to the API at runtime to control logging information. However, another important aspect of any logging mechanism is the way the logs are produced and maintained. It is vitally important for an application to structure and produce logging information that can be analyzed and processed later. In order to achieve this aspect of logging, it is essential that logging information can be produced in different formats. The JDK 1.4 logging API provides two basic mechanisms for producing logging information that is human readable and appropriate for any future processing. The objects that accomplish the task of producing log information in different formats are called Formatter objects. In this chapter, we will examine the default Formatter objects provided within the API and explore how to write new Formatter objects.

Read the paper · More papers on PaperTik