June 2018
Intermediate to advanced
408 pages
11h 23m
English
This section explains Java's built-in logging mechanism. The Java logging API is comprised of the java.util.logging package. The core package includes support for writing plain text or XML log entries to output streams, files, memory, the console, or sockets. The logging API is also capable of interacting with already existing logging services on the operating system.
The following code example is used for printing log messages using the standard logging API:
package com.packt.springhighperformance.ch9.logging;import java.io.FileInputStream;import java.io.IOException;import java.sql.Timestamp;import java.util.logging.Level;import java.util.logging.LogManager;import java.util.logging.Logger;public class SampleLoggingOne ...
Read now
Unlock full access