Looking at your log4j.properties it0's absolute clear what happens
1. You have NO LOGGERS DEFINED for each webservice
2. only the root logger is defined,
3. and each appender is an appender of the root logger
4. so the root logger is the only logger which logs your events
5. in this case defining additivity is useless because
6. you log at the root logger only,
7. that is to say all events go into the root loggers-appenders
give your ws1 class is as such
#package com.company.webservice
class ws1
....
# define your loggers specific per web service class/type
log4j.logger.com.company.webservice.ws1=DEBUG fileLogging1
log4j.logger.com.company.webservice.ws2=DEBUG fileLogging2
log4j.logger.com.company.webservice.ws3=DEBUG fileLogging3
#prevent that logging events are propagated
log4j.additivity.com.company.webservice.ws1 =false
log4j.additivity.com.company.webservice.ws2 =false
log4j.additivity.com.company.webservice.ws3 =false
# Appender fichero numero 1
log4j.appender.fileLoggin1=org.apache.log4j.RollingFileAppender
log4j.appender.fileLoggin1.layout=org.apache.log4j.PatternLayout
log4j.appender.fileLoggin1.layout.ConversionPattern= [%d{dd MMM yyyy HH:mm:ss}]
: %m : %l %n
log4j.appender.fileLoggin1.File=/tomcat/tomcat/logs/ovc_ws/ovc_ws-total1.log
***** unique *****
log4j.appender.fileLoggin1.MaxFileSize=5120KB
log4j.appender.fileLoggin1.MaxBackupIndex=5
log4j.appender.fileLoggin1.Append=true
# Appender fichero numero 2
log4j.appender.fileLoggin2=org.apache.log4j.RollingFileAppender
log4j.appender.fileLoggin2.layout=org.apache.log4j.PatternLayout
log4j.appender.fileLoggin2.layout.ConversionPattern= [%d{dd MMM yyyy HH:mm:ss}]
: %m : %l %n
log4j.appender.fileLoggin2.File=/tomcat/tomcat/logs/ovc_ws/ovc_ws-total2.log
***** unique *****
log4j.appender.fileLoggin2.MaxFileSize=5120KB
log4j.appender.fileLoggin2.MaxBackupIndex=5
log4j.appender.fileLoggin2.Append=true
# Appender fichero numero 3
log4j.appender.fileLoggin3=org.apache.log4j.RollingFileAppender
log4j.appender.fileLoggin3.layout=org.apache.log4j.PatternLayout
log4j.appender.fileLoggin3.layout.ConversionPattern= [%d{dd MMM yyyy HH:mm:ss}]
: %m : %l %n
log4j.appender.fileLoggin3.File=/tomcat/tomcat/logs/ovc_ws/ovc_ws-total3.log
***** unique *****
log4j.appender.fileLoggin3.MaxFileSize=5120KB
log4j.appender.fileLoggin3.MaxBackupIndex=5
log4j.appender.fileLoggin3.Append=true
This is not your end of the story, because, if you have 3 users and each has 3
sessions and you want to have logs for each user-session then you need to have
9 log files; with the setup above each user logs per web service to the same
log file. How do you intend to separate that each user-session reports into a
session log file? So you need to programmatically create a
user-session-specific logger-name, get appender info from the log4j.properties
and add the session id to the log file.
Josef
Von: Oscar Rugama [mailto:[email protected]]
Gesendet: Montag, 21. Januar 2013 10:24
An: [email protected]
Betreff: RE: AW: AW: Ws Axis2 several logs goes to one log
Ok, thanks for explain in detail but no idea if this is the problem i have with
the logs
Regards
Oscar
________________________________
Subject: AW: AW: Ws Axis2 several logs goes to one log
Date: Mon, 21 Jan 2013 10:18:27 +0100
From: [email protected]
To: [email protected]
additivity prevents that logging events are propagated toward the root logger
or any logger higher in the hierarchy. log4j forms is a hierarchy of loggers
following a com.axa.ch.xyz.abc schema; that is to say the com.axa.ch.xyz.abc
logger must have an appender and its additivity must be set false for that
logger
to prevent that the same logging event i.e. reaches a logger i.e. com.axa.ch or
even the root logger.
Josef
Von: Oscar Rugama [mailto:[email protected]]
Gesendet: Montag, 21. Januar 2013 10:03
An: [email protected]
Betreff: RE: AW: Ws Axis2 several logs goes to one log
Hi Morgan, Josef:
First thanks for answering, i´ll try to answer your questions as best as
possible:
1. Each web service has it´s own log4j.properties
2. Yes it has unique appender
3. Could you please explain me what´s additivity?
4. Yes here you have two example
log1.properties
log4j.rootLogger=ERROR, fileLoggin
# Appender fichero
log4j.appender.fileLoggin=org.apache.log4j.RollingFileAppender
log4j.appender.fileLoggin.layout=org.apache.log4j.PatternLayout
log4j.appender.fileLoggin.layout.ConversionPattern= [%d{dd MMM yyyy HH:mm:ss}]
: %m : %l %n
#log4j.appender.fileLoggin.File=D:/logs/ovc_ws/ovc_ws-total.log
#log4j.appender.fileLoggin.File=/opt/hpws/tomcat_iberdrola/logs/ovc_ws/ovc_ws-total.log
log4j.appender.fileLoggin.File=/tomcat/tomcat/logs/ovc_ws/ovc_ws-total.log
log4j.appender.fileLoggin.MaxFileSize=5120KB
log4j.appender.fileLoggin.MaxBackupIndex=5
log4j.appender.fileLoggin.Append=true
log2.properties
log4j.rootLogger=ERROR, fileLogginSC
# Appender fichero
log4j.appender.fileLogginSC=org.apache.log4j.RollingFileAppender
log4j.appender.fileLogginSC.layout=org.apache.log4j.PatternLayout
log4j.appender.fileLogginSC.layout.ConversionPattern= [%d{dd MMM yyyy
HH:mm:ss}] : %m : %l %n
log4j.appender.fileLogginSC.File=C:/logs/solvencia_center/solvencia_center-total.log
#log4j.appender.fileLogginSC.File=/tomcat/tomcat/logs/solvencia_center/solvencia_center-total.log
#log4j.appender.fileLogginSC.File=/opt/hpws/tomcat_iberdrola/logs/solvencia_center/solvencia_center-total.log
#log4j.appender.fileLogginSC.File=/opt/hpws/apache-tomcat-6.0.35/logs/solvencia_center/solvencia_center-total.log
log4j.appender.fileLogginSC.MaxFileSize=5120KB
log4j.appender.fileLogginSC.MaxBackupIndex=5
log4j.appender.fileLogginSC.Append=true
Thanks in advance for your help
Kind regards
________________________________
Subject: AW: Ws Axis2 several logs goes to one log
Date: Mon, 21 Jan 2013 09:52:05 +0100
From: [email protected]
To: [email protected]
Hi, Morgan, Oscar
1. has each web service / class its own logger defined i.e. in
log4j.properties
2. has each logger at least one appender defined, unique for that logger
3. is for each logger the additivity set to false
4. see example in appender
Josef
Von: Morgan Humes [mailto:[email protected]]
Gesendet: Freitag, 18. Januar 2013 13:43
An: [email protected]
Betreff: Re: Ws Axis2 several logs goes to one log
Are you using the same logging category for all three services?
Morgan
Oscar Rugama <[email protected]> wrote:
Hi,
I´ve deployed three web Services on my Axis2 container and something
stranged it´s happening, i thinki it´s not critial at all, but at least it
bother us.
As i said, we have deployed three web services nad each webservice has
its own log4j with its own log4.properties, what it happens it´´s than when
axis2 starts, all the logs all of these three web services goes to only log.
I´ll explain with example
ie: Ws1 has log1
Ws2 has log2
Ws3 has log3
If i deploy ws in this way, first Ws1, Sencond Ws2 and third Ws3 , all the
logs will go to log3
If i undeploy Ws2 and deploy again Ws2 what it happens it´s that all logs go
to log2.
Every time i redeploy a Ws all the logs go to the log of the Ws i´ve deployed
Are there any way to have three logs working separately? Each Ws with eahc log
Thanks
Regards,
Oscar
--------------------------------------------------------------------- To
unsubscribe, e-mail: [email protected] For additional
commands, e-mail: [email protected]