Hi I am using Websphere 5.1 Application Server. I would like to log the business logs into a file other than Systemout.log and SystemErr.log , I mean i need a separate log file for this , How do i configure this in websphere Thanks in Advance
We have used log4j for logging purpose in our application. The main players in the architecture of log4j are the loggers, appenders, and layouts. Typically, there is a logger object for every class in the application that has logging needs. A typical application class will ask for a logger class, and then use it to create the log messages with a particular level associated with the message. The appenders are essentially output destinations. There are many appenders available within log4j (e.g., file, database, NT Event logs, etc). Layouts are the formatters for the message.
How to install Log4j?
Simply add the log4j jar file to your classpath. Web applications should add log4j.jar to WEB-INF/lib. If you are using an XML configuration file (recommended), then you will also need JAXP and its associated files in your classpath. For information on JAXP, see the Java API for XML Processing (JAXP) How-To Guide. The log4j.dtd file is not needed. It is extracted from the log4j.jar file, and passed to the XML parser automatically. If you want your XML file to be validated while editing with WSAD, simply include the log4j.dtd in the same directory as your XML file.
"i would like to change the world, but they would not give me the source code"
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad: