
{filelink=4527}
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
public class MonLog {
public static void main(String[] args) throws Exception {
Logger logger = Logger.getLogger("MonLog");
FileHandler fh;
fh = new FileHandler("c:\MonPremierFichierLog.log", true);
logger.addHandler(fh);
logger.setLevel(Level.ALL);
SimpleFormatter formatter = new SimpleFormatter();
fh.setFormatter(formatter);
logger.log(Level.WARNING, "Mon premier log");
}
}