Changing the default log message format

In this post I will be explaining how to change the default log message format provided by java util loggging. In case of logging to console (done by ConsoleHandler), the default format used is an instance of java.util.logging.SimpleFormatter. In case of logging to file (done by FileHandler), the default format used is an instance of…… Continue reading Changing the default log message format

Redirecting logging to a file

In this post I will explain how to program the logger to log messages to a file instead of logging to console. Below is the code Main code 1 package Logging; 2 3 import java.io.IOException; 4 import java.util.logging.FileHandler; 5 import java.util.logging.Logger; 6 7 public class LoggingDemo2 { 8 public static void main(String[] args) throws IOException…… Continue reading Redirecting logging to a file