Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

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

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
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.
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!