Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

configuring log4j

Status
Not open for further replies.

sandeepmur

Programmer
Dec 14, 2003
295
PT
Hi,

I have to generate logs with some user tracking data for some sites. My colleagues are working on an application which is using Log4j for registering various events.

My first question is whether should I be using log4j to accomplish my task too ? afterall, all thats required is to have a java class which accepts some data and writes to a txt file and is called everytime a user performs a certain task. Ofcourse, the class might be called simultaneously from multiple users which might cause some problem.

Alternatively, If I decide to use log4j, how can I configure it ?? there are 3 issues as as I know to be dealt with:

1. The application using log4j is already using an appender to write to a txt file. Is it possible to generate another txt file only with the data I need ??

2. I noticied that log4j has 5 methods debug,info,warn, error and fatal with info the most used one. Can I reuse info to write to my file or can I add another method ??

3. I noticied that its possible to set the conversion pattern to determine what kind of output we need. In my case, the only output to the file should be the data I want period.

I am kinda confused over all this and hope someone can throw some light!

thnx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top