devxlogo

Setting Logger Output with FOP

Setting Logger Output with FOP

The following code demonstrates how to set a logger for FOP. You can send the logger’s messages to the System.out or in a file like this:

//to System.outLogger logger=new ConsoleLogger(ConsoleLogger.LEVEL_INFO);fop.setLogger(logger);MessageHandler.setOutputMethod(MessageHandler.SCREEN);MessageHandler.setScreenLogger(logger); //to a file (the log.txt file)MessageHandler.setOutputMethod(MessageHandler.FILE);MessageHandler.setLogfileName("log.txt",true);  

devx-admin

Share the Post: