Source Code : Java Log:Basic Logging
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Java Log:Basic Logging

import java.util.logging.*;
import java.io.*;
public class BasicLogging {
private static Logger logger = Logger.getLogger("MyLogger");
private ConsoleHandler console = null;
private FileHandler file = null;
public BasicLogging()
{
console = new ConsoleHandler();
try{
file = new FileHandler("basicLogging.out");
}catch(IOException ioe){
logger.warning("Could not create a file...");
}
logger.addHandler(console);
logger.addHandler(file);
}
public void logMessage()
{
logger.info("I am logging test message..");
}
public static void main(String args[])
{
BasicLogging demo = new BasicLogging();
demo.logMessage();
}
}
Thank with us