JDK 1.4 Tutorial, eDoc 4 : Instrumenting Your Code with Logging Messages
Book Details
Author(s)Gregory Travis
PublisherManning Publications
ISBN / ASINB00006928R
ISBN-13978B000069283
AvailabilityAvailable for download now
Sales Rank11,449,549
MarketplaceUnited States 🇺🇸
Description
There are a number of logging systems that have been created for Java, but lack of standardization has prevented them from reaching their full potential. JDK 1.4 comes complete with a new API that lets you log important run-time information from your Java program. It provides multiple detail levels and multiple configuration methods.
This e-doc will teach you how to get the most out of this new feature -- how to set up logging, and how to decide what information to log, and how. You'll also learn how to customize logging to suit your specific needs.
This e-doc will show you how to:
- Log message from your program
- Set up logging for a package
- Use different logging levels for different messages
- Create a custom Handler
- Create a custom Filter
- Create a custom Formatter
- Deal with logging efficiency issues
- Configure logging from a configuration file
- Configure logging from code
Sample programs included in this chapter:
- A chat (instant messaging) server with a full set of logging statements
- A GUI interface to the logging system
- A custom formatter that emits briefer messages






