When Spring loads the application context, it creates the beans following its own particular order. Irrespective of the order in which it creates the beans, it makes sure that a bean’s dependency (which are other beans) are set before the beans is ready of use. Below code will give you an example of what I am…… Continue reading Spring depends-on attribute
Month: July 2017
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