Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configuring the Business Logs into a separate log file other than SystemOut.log

 
rajesh kartha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Thanks and Regards
Rajesh Kartha
 
rahul shandy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic