Posted By:
dan_pudwell
Posted On:
Friday, January 22, 2010 06:13 AM
Hello I would to direct stdout to the log but have only seen examples of this where there is a properties file. I would not like to use a properties file (xml or normal text) but instead would like to define all the properties in the class. I have included a sample class below which is similar to what I have coded already. Any help is appreciated. public class Util_Logger { static Logger = Logger.getRootLogger(); static{ FileAppender appender = new FileAppender(new SimpleLayout(), LOG_LOCATION); logger.addAppender(appender); logger.setLevel(Level.ERROR); } //further code to define logging statements
More>>
Hello
I would to direct stdout to the log but have only seen examples of this where there is a properties file. I would not like to use a properties file (xml or normal text) but instead would like to define all the properties in the class. I have included a sample class below which is similar to what I have coded already. Any help is appreciated.
public class Util_Logger
{
static Logger = Logger.getRootLogger();
static{
FileAppender appender = new FileAppender(new SimpleLayout(), LOG_LOCATION);
logger.addAppender(appender);
logger.setLevel(Level.ERROR);
}
//further code to define logging statements
}
<<Less