Sunday, November 30, 2008

Java logger

import java.util.logging.Logger;
import java.util.logging.FileHandler;
import java.util.logging.SimpleFormatter;
import java.util.logging.Level;

logger = Logger.getLogger("com.mycompany.conversion"); // logger internal name
FileHandler fileHandler = new FileHandler("basic.conversion.txt", 1000, 1);
fileHandler.setFormatter(new SimpleFormatter());
logger.addHandler(fileHandler);
logger.log(Level.INFO, " Initializing GgWebService");

See also:
C:\Program Files\Java\jdk1.6.0_10\jre\lib\logging.properties
.

No comments: