AW: tomcat 5.5 -- log4j error

2011-06-21 Thread Stadelmann Josef
Here I have concerns with 
org.apache.catalina.core.­StandardContext start
the little -

where does it come from?

Can you remove your apps and just start tomcat configured to use log4j?
Swith on log4j debug true to see how your 

And if Tomcat Server starts properly without any errors in your log4j
Then aou can deploy your web apps and see what log4j loggs.

Also why the dash? ...configuration=log4j.-xml
- is just dangerous!

Josef


-Ursprüngliche Nachricht-
Von: WEIQUAN YUAN [mailto:weiquan.y...@gmail.com] 
Gesendet: Montag, 20. Juni 2011 17:54
An: log4j-user@logging.apache.org
Betreff: tomcat 5.5 -- log4j error

20-Jun-2011 9:19:24 AM org.apache.catalina.core.­StandardContext start
SEVERE: Error listenerStart
20-Jun-2011 9:19:24 AM org.apache.catalina.core.­StandardContext start
SEVERE: Context [/testPhoenix] startup failed due to previous errors
log4j:ERROR LogMananger.repositorySelector was null likely due to
error in class reloading, using NOPLoggerRepository.

Here is my environment

 1. What exact version of Tomcat 5.5.x you are using?
5.5.17.0

 2. It says that it is class loading issue. What jars to you have on
 the server ind in your webapp?
there are a lot of jars i used for this webapp, including spring, dwr,
log4j, mail, esapi, jstl, json, common, activation, .

 And what version of log4j you are using?
log4j-1.2.15.jar,

 3. How logging is configured in your webapp and in Tomcat?
using -Dlog4j.configuration=log4j.­xml in tomcat startup script and put
log4j.xml in WEB-INF/classes


-- 
Weiquan Yuan
Located in Ottawa - Capital Region of Canada
Email: weiquan.y...@gmail.com

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



configuring individually loggingf for every war application in an ear project

2011-06-21 Thread Melih U . Ünsal
My ear project consists of two war applications. i want to create logs
individually for every war. i mean every war projects must create its own
logs. But, because of they run in the same jvm, i am not sure whether it is
possible or not.
how can i handle this issue?

By the way, the war applications are spring projects.

i created two log4j config files (log4j_app1.xml and log4j_app2.xml) and
instantiated them in the applicationcontexts but it did not solve the
problem.

WAR_APP1 applcaitoncontext.xml :

bean id=log4jInitialization
class=org.springframework.beans.factory.config.MethodInvokingFactoryBean
property name=targetClass
value=org.springframework.util.Log4jConfigurer /
property name=targetMethod value=initLogging /
property name=arguments
list
value/config/log4j_app1.xml/value
/list
/property
/bean


WAR_APP2 applcaitoncontext.xml :

bean id=log4jInitialization
class=org.springframework.beans.factory.config.MethodInvokingFactoryBean
property name=targetClass
value=org.springframework.util.Log4jConfigurer /
property name=targetMethod value=initLogging /
property name=arguments
list
value/config/log4j_app2.xml/value
/list
/property
/bean


log4j_app1.xml

?xml version=1.0 encoding=UTF-8?
!DOCTYPE log4j:configuration SYSTEM 
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd

log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;

appender name=appender
class=org.apache.log4j.DailyRollingFileAppender
param name=DatePattern value='.'-MM-dd/
param name=File value=/logs/app1/app1.log/
param name=Append value=true/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d [%t] %p - %m%n/
/layout
/appender

appender name=console class=org.apache.log4j.ConsoleAppender
param name=Target value=System.out/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d  - %5p %c{1} - %m%n/
/layout
/appender

root

priority value=info/
appender-ref ref=appender/
appender-ref ref=console/

/root

/log4j:configuration
log4j_app2.xml

?xml version=1.0 encoding=UTF-8?
!DOCTYPE log4j:configuration SYSTEM 
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd

log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;

appender name=appender_ui
class=org.apache.log4j.DailyRollingFileAppender
param name=DatePattern value='.'-MM-dd/
param name=File value=/logs/app2/app2.log/
param name=Append value=true/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d [%t] %p - %m%n/
/layout
/appender

appender name=console_ui class=org.apache.log4j.ConsoleAppender
param name=Target value=System.out/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d  - %5p %c{1} - %m%n/
/layout
/appender

root

priority value=info/
appender-ref ref=appender_ui/
appender-ref ref=console_ui/

/root

/log4j:configuration


Re: configuring individually loggingf for every war application in an ear project

2011-06-21 Thread Jacob Kjome


If the webapps are configured to use child-first, or parent-last, classloading 
and log4j.jar is in WEB-INF/lib and log4j.xml is in WEB-INF/classes (or you 
specify the config path yourself using the Spring configuration utility), then 
logging should be separated.


Shared libraries located outside of WEB-INF/lib (such as in APP-INF/lib under 
Weblogic) can be problematic since they'll have dependency on Log4j and won't 
be able to reference it under each webapp's WEB-INF/lib.


The other option is a repository selector, but that entails some more 
complication.  There's documentation for it in the logging-log4j wiki [1].  
You may still end up with problems when shared libraries log using static 
loggers, though, since they will be tied to the configuration of the first app 
that accesses them.


[1] http://wiki.apache.org/logging-log4j/AppContainerLogging


Jake

On Tue, 21 Jun 2011 18:03:20 +0300
 Melih U. Ünsal melihun...@gmail.com wrote:

My ear project consists of two war applications. i want to create logs
individually for every war. i mean every war projects must create its own
logs. But, because of they run in the same jvm, i am not sure whether it is
possible or not.
how can i handle this issue?

By the way, the war applications are spring projects.

i created two log4j config files (log4j_app1.xml and log4j_app2.xml) and
instantiated them in the applicationcontexts but it did not solve the
problem.

WAR_APP1 applcaitoncontext.xml :

bean id=log4jInitialization
class=org.springframework.beans.factory.config.MethodInvokingFactoryBean
property name=targetClass
value=org.springframework.util.Log4jConfigurer /
property name=targetMethod value=initLogging /
property name=arguments
list
value/config/log4j_app1.xml/value
/list
/property
/bean


WAR_APP2 applcaitoncontext.xml :

bean id=log4jInitialization
class=org.springframework.beans.factory.config.MethodInvokingFactoryBean
property name=targetClass
value=org.springframework.util.Log4jConfigurer /
property name=targetMethod value=initLogging /
property name=arguments
list
value/config/log4j_app2.xml/value
/list
/property
/bean


log4j_app1.xml

?xml version=1.0 encoding=UTF-8?
!DOCTYPE log4j:configuration SYSTEM 
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd

log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;

appender name=appender
class=org.apache.log4j.DailyRollingFileAppender
param name=DatePattern value='.'-MM-dd/
param name=File value=/logs/app1/app1.log/
param name=Append value=true/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d [%t] %p - %m%n/
/layout
/appender

appender name=console class=org.apache.log4j.ConsoleAppender
param name=Target value=System.out/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d  - %5p %c{1} - %m%n/
/layout
/appender

root

priority value=info/
appender-ref ref=appender/
appender-ref ref=console/

/root

/log4j:configuration
log4j_app2.xml

?xml version=1.0 encoding=UTF-8?
!DOCTYPE log4j:configuration SYSTEM 
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd

log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;

appender name=appender_ui
class=org.apache.log4j.DailyRollingFileAppender
param name=DatePattern value='.'-MM-dd/
param name=File value=/logs/app2/app2.log/
param name=Append value=true/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d [%t] %p - %m%n/
/layout
/appender

appender name=console_ui class=org.apache.log4j.ConsoleAppender
param name=Target value=System.out/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d  - %5p %c{1} - %m%n/
/layout
/appender

root

priority value=info/
appender-ref ref=appender_ui/
appender-ref ref=console_ui/

/root

/log4j:configuration



-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



AW: configuring individually loggingf for every war application in an ear project

2011-06-21 Thread Stadelmann Josef
Define loggers and appenders for each war! Then if you see that messages get 
logged twice find who is logging it. Then set the additivity for that logger to 
false, and that's prevents that logrecords from this identified logger are 
propagated upward in the logger hierarchy to the next more common logger. Look 
to loggers as a tree where only the loggeers at the leafe positioon shall log 
and by using additivity=false for that logger the leave logger will not 
propagate the message to the trees and more toward the root logger.

My apps has many loggers .

# ---
#- Set your loggers priority to what you need ---
# Logger logging WHAT it logs   WHO is actually logging
log4j.logger.org.apache.catalina=INFO,  CONSOLE, R, CHAINSAW_CLIENT
log4j.logger.org.apache.coyote=INFO,CONSOLE, R, CHAINSAW_CLIENT
log4j.logger.org.apache.jasper=INFO,CONSOLE, R, CHAINSAW_CLIENT
log4j.logger.org.apache.jk=INFO,CONSOLE, R, CHAINSAW_CLIENT
log4j.logger.org.apache.tomcat=INFO,CONSOLE, R, CHAINSAW_CLIENT
log4j.logger.org.apache.commons=INFO,   CONSOLE, R, CHAINSAW_CLIENT
log4j.logger.org.apache.axiom=WARN, CONSOLE, R, CHAINSAW_CLIENT
log4j.logger.org.apache.axis2=INFO, CONSOLE, R, CHAINSAW_CLIENT
log4j.logger.org.apache.axis2.deployment=DEBUG, CONSOLE, R, CHAINSAW_CLIENT
log4j.logger.de.hunsicker.jalopy.io=FATAL,  CONSOLE, R, CHAINSAW_CLIENT
log4j.logger.httpclient.wire.header=FATAL,  CONSOLE, R, CHAINSAW_CLIENT

# ---
#- create the SpServer Logger ---
# this is the CONFIGURED logger for the SpServer.java JavaPart
# the Configurator strips of the logger_prefix log4j.logger.
#  the logger is then known in the hierarchy as
#   axawl.spezpla.servers.SpezplaService.SpServer
#retrive this configured logger from log4j.hierarchy through
# Logger log = Logger.getLogger(SpServer.class);
log4j.logger.axawl.spezpla.servers.SpezplaService.SpServer=INFO, LOGFILE, 
CHAINSAW_AXIS2


# ---
# define the additivities used to prevent logging twice the same msg
# NOTE: each logger needs an additivity set or you risk logging twice
#
log4j.additivity.org.apache.axiom=false
log4j.additivity.org.apache.axis2=false
log4j.additivity.org.apache.axis2.deployment=false
log4j.additivity.org.apache.catalina=false
log4j.additivity.org.apache.coyote=false
log4j.additivity.org.apache.jasper=false
log4j.additivity.org.apache.jk=false
log4j.additivity.org.apache.commons=false


# to prevent that logging events are propagated to parent loggers
# and finally arrive at the root loggers appender, printed to the root-
# loggers files i.e. additivity must be set to false to prevent this.
# please goto http://logging.apache.org/log4j/1.2/manual.html and read
# the short manual or buy the full manual
log4j.additivity.axawl.spezpla.servers.SpezplaService.SpServer=false

Josef


-Ursprüngliche Nachricht-
Von: Melih U. Ünsal [mailto:melihun...@gmail.com] 
Gesendet: Dienstag, 21. Juni 2011 17:03
An: log4j-user@logging.apache.org
Betreff: configuring individually loggingf for every war application in an ear 
project

My ear project consists of two war applications. i want to create logs
individually for every war. i mean every war projects must create its own
logs. But, because of they run in the same jvm, i am not sure whether it is
possible or not.
how can i handle this issue?

By the way, the war applications are spring projects.

i created two log4j config files (log4j_app1.xml and log4j_app2.xml) and
instantiated them in the applicationcontexts but it did not solve the
problem.

WAR_APP1 applcaitoncontext.xml :

bean id=log4jInitialization
class=org.springframework.beans.factory.config.MethodInvokingFactoryBean
property name=targetClass
value=org.springframework.util.Log4jConfigurer /
property name=targetMethod value=initLogging /
property name=arguments
list
value/config/log4j_app1.xml/value
/list
/property
/bean


WAR_APP2 applcaitoncontext.xml :

bean id=log4jInitialization
class=org.springframework.beans.factory.config.MethodInvokingFactoryBean
property name=targetClass
value=org.springframework.util.Log4jConfigurer /
property name=targetMethod value=initLogging /
property name=arguments
list
value/config/log4j_app2.xml/value
/list
/property
/bean


log4j_app1.xml

?xml version=1.0 encoding=UTF-8?
!DOCTYPE log4j:configuration SYSTEM 
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd

log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;

appender name=appender
class=org.apache.log4j.DailyRollingFileAppender
param name=DatePattern value='.'-MM-dd/
param