Hi,

One can set priority for logging in case it affects application performance
i.e., log only what's required, rest you can switch it off by setting log
category to high (from WARN or ERROR ---> FATAL).

We are into online booking engine and we have database of more than 70,000
customers and thousands of airline fares and other info accessed by approx.
200 users at a given point of time. Logging important info to a log file
does not affect our app.

Example
----------------
# Roll - Logging into a file
log4j.appender.Roll=org.apache.log4j.RollingFileAppender
log4j.appender.Roll.File=${InstanceName}.log
log4j.appender.Roll.MaxFileSize=10MB
log4j.appender.Roll.MaxBackupIndex=100
log4j.appender.Roll.layout=org.apache.log4j.PatternLayout
log4j.appender.Roll.layout.ConversionPattern=%x %d{yyyy.MM.dd HH:mm:ss,SSS}
%5p [%t] (%c:%-4L %M) - %m%n

#######################################################
# Class list with priority settings
#
#######################################################
# List of possible priorities: DEBUG, INFO, WARN, ERROR, FATAL 
# List of possible priorities: debug, info, warn, error, fatal


########################################################
# Framework1: DynamicResources 
########################################################
log4j.category.ResResourceManager=FATAL
log4j.category.ResApplication=ERROR
log4j.category.ResTools=FATAL log4j.category.ResVisualComponent=FATAL
log4j.category.ResPageContext=FATAL
log4j.category.ResSessionR=ERROR
.............................
.............................


########################################################
# Framework2: ArnoldPpesentationLayer 
########################################################
log4j.category.SideNavBarUser=ERROR
log4j.category.FFareMainL=ERROR
log4j.category.CATasksL=ERROR log4j.category.CADenyTask_DenyDetails=ERROR

.............................
.............................


########################################################
# Framework3: Core 
########################################################
log4j.category.BaseApplication=INFO
log4j.category.CoreApllication=INFO
log4j.category.CoreBTBFareUtilities=ERROR
log4j.category.CoreBTBUtility=FATAL
.............................
.............................



########################################################
# Application: Airside 
########################################################
log4j.category.Application=INFO
log4j.category.Session=INFO
log4j.category.MainMenu=INFO log4j.category.PaymentDueReport=ERROR
.............................
.............................


-----Original Message-----
From: Shinobu Kawai [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 13, 2004 7:39 AM
To: Struts Users Mailing List
Subject: Re: logging



Hi Ravi,

> No ..no...its not an issue at all.
> 
> Use it the way "Apurva" has mentioned.
> 
> It works !!
Yes, that would be one solution.  I am providing another solution. 
It's just a matter of HOW.  Which solution to pick is up to Viral.

As for me, the main reason to use commons-logging is to decouple my
application from the logging framework.  Putting that in mind, Apurva's
solution is far from my philosophy.

BTW, Viral, you can just add a "%M" to your ConversionPattern and it will be
replaced by the method name!  But be sure to read the comment on
 
http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html
about performance issues.

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <[EMAIL PROTECTED], [EMAIL PROTECTED]>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to