Results 1 to 1 of 1
- 01-22-2010, 12:01 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 1
- Rep Power
- 0
How to put stdout in a class instead of a properties file??
Hello
Not really a beginner but all the log4j questions seem to be in here.
I would like 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
}
Similar Threads
-
Is there a better way to read from stdout?
By iceagecoming in forum New To JavaReplies: 6Last Post: 11-06-2009, 09:45 PM -
log4j: Multiple entries on Tomcat stdout file using log.error
By pbs in forum Web FrameworksReplies: 1Last Post: 10-24-2009, 02:18 AM -
Unable to access velocity.properties file from jar file
By mjwoodford in forum New To JavaReplies: 0Last Post: 10-09-2009, 01:46 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks