Saturday 2 August 2014

Java Logging



Logging is the process of writing log messages during the execution of a program. Logging place a vital role while debugging an Application. Logging using java.util.logging package is depicted in above figure. Logging is done using Logger instance. Loggers get the data and make them in the form of LogRecord and send them to the Handlers. Handlers written the data to external world like consoles, files, network sockets etc.,

As shown in the figure Filters are associated with both loggers and handlers. Filters decide whether to forward or discard particular log record.

Handlers use formatters to format the data. A Formatter provides support for formatting LogRecords. SimpleFormatter, XMLFormatter are provided by java.util.logging package.



Prevoius                                                 Next                                                 Home

No comments:

Post a Comment