Re: Log4j 2.15.0 and Tomcat 9.0.56

2021-12-20 Thread Johan Compagner
that is a class that is being loaded on java 8 and it wants java 9
but log4j as far as i know supports even java 7.. so i have a feeling that
can't be it (that it won't run on java 8)

On Mon, 20 Dec 2021 at 19:15, Daniela Morais  wrote:

> I'm trying to upgrade Log4j2 dependencies to 2.15.0 and I'm facing
> this issue. Is there any workaround or the only option is to upgrade
> Java?
>
> Configs
> Java 8
> Tomcat 9.0.56
>
> Log
> 20-Dec-2021 15:10:45.177 SEVERE [RMI TCP Connection(2)-127.0.0.1]
> org.apache.catalina.core.StandardContext.listenerStart Exception
> sending context initialized event to listener instance of class
> [org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener]
> java.lang.UnsupportedClassVersionError:
> META-INF/versions/9/module-info has been compiled by a more recent
> version of the Java Runtime (class file version 53.0), this version of
> the Java Runtime only recognizes class file versions up to 52.0
> (unable to load class [META-INF.versions.9.module-info])
> at
> org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2483)
> at
> org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:870)
> at
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1371)
> at
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1215)
> at
> com.ocpsoft.pretty.faces.config.annotation.AbstractClassFinder.processClass(AbstractClassFinder.java:216)
> at
> com.ocpsoft.pretty.faces.config.annotation.WebLibFinder.processJarFile(WebLibFinder.java:141)
> at
> com.ocpsoft.pretty.faces.config.annotation.WebLibFinder.findClasses(WebLibFinder.java:85)
> at
> com.ocpsoft.pretty.faces.config.spi.AnnotationConfigurationProvider.loadConfiguration(AnnotationConfigurationProvider.java:82)
> at
> com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:63)
> at
> org.ocpsoft.rewrite.prettyfaces.PrettyConfigContextListener.contextInitialized(PrettyConfigContextListener.java:41)
> at
> org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener.contextInitialized(RewriteServletContextListener.java:38)
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768)
> at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230)
> at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
> at
> org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1783)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:293)
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
> at
> org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:460)
> at
> org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:408)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:293)
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
> at
> com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
> at
> javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
> at
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
>

Re: Log4j 2.15.0 and Tomcat 9.0.56

2021-12-20 Thread Sebastian Hennebrüder
We are running Tomcat 9 on Java 11 without any issues, but you probably want to 
test it with your application.

> Am 20.12.2021 um 19:15 schrieb Daniela Morais :
> 
> I'm trying to upgrade Log4j2 dependencies to 2.15.0 and I'm facing
> this issue. Is there any workaround or the only option is to upgrade
> Java?
> 
> Configs
> Java 8
> Tomcat 9.0.56
> 
> Log
> 20-Dec-2021 15:10:45.177 SEVERE [RMI TCP Connection(2)-127.0.0.1]
> org.apache.catalina.core.StandardContext.listenerStart Exception
> sending context initialized event to listener instance of class
> [org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener]
>java.lang.UnsupportedClassVersionError:
> META-INF/versions/9/module-info has been compiled by a more recent
> version of the Java Runtime (class file version 53.0), this version of
> the Java Runtime only recognizes class file versions up to 52.0
> (unable to load class [META-INF.versions.9.module-info])
>at 
> org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2483)
>at 
> org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:870)
>at 
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1371)
>at 
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1215)
>at 
> com.ocpsoft.pretty.faces.config.annotation.AbstractClassFinder.processClass(AbstractClassFinder.java:216)
>at 
> com.ocpsoft.pretty.faces.config.annotation.WebLibFinder.processJarFile(WebLibFinder.java:141)
>at 
> com.ocpsoft.pretty.faces.config.annotation.WebLibFinder.findClasses(WebLibFinder.java:85)
>at 
> com.ocpsoft.pretty.faces.config.spi.AnnotationConfigurationProvider.loadConfiguration(AnnotationConfigurationProvider.java:82)
>at 
> com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:63)
>at 
> org.ocpsoft.rewrite.prettyfaces.PrettyConfigContextListener.contextInitialized(PrettyConfigContextListener.java:41)
>at 
> org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener.contextInitialized(RewriteServletContextListener.java:38)
>at 
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768)
>at 
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230)
>at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
>at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
>at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
>at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
>at 
> org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1783)
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>at java.lang.reflect.Method.invoke(Method.java:498)
>at 
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:293)
>at 
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
>at 
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
>at 
> org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:460)
>at 
> org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:408)
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>at java.lang.reflect.Method.invoke(Method.java:498)
>at 
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:293)
>at 
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
>at 
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
>at 
> com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
>at 
> javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
>at 
> javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
>at 
> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
>at java.security.AccessController.doPrivileged(Native Method)
>at 
> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
>at 
> 

Re: log4j CVE general question

2021-12-13 Thread Christopher Schultz

Jon,

On 12/13/21 12:48, jonmcalexan...@wellsfargo.com.INVALID wrote:

I understand Chris. I guess I was looking to see if he had contact
info for anyone on that particular project. I know it's not like a
"company".

It's just like Tomcat: they have a public mailing list.

-chris

-Original Message-
From: Christopher Schultz 
Sent: Monday, December 13, 2021 11:39 AM
To: users@tomcat.apache.org
Subject: Re: log4j CVE general question

Jon,

On 12/13/21 11:51, jonmcalexan...@wellsfargo.com.INVALID wrote:

So, based on these entries on the log4j apache pages, I can't see that
any 1x product is vulnerable. Mark, is there some message from Apache
that we can share with those that need to know that for certain 1x
log4j is NOT vulnerable?

This is not something the Tomcat team (or Mark, individually) can really do
for you.

You should check for information from the log4j team.

Unofficially, log4j 1.x does not seem to be affected. There were some
questions about configuring it for use with a JMS appender, but it seems
those issues would be limited to having a compromised JMS server or an
injection into JNDI from another (unrelated) exploit.

-chris





News
CVE-2021-44228

The Log4j team has been made aware of a security vulnerability, CVE-2021-

44228, that has been addressed in Log4j 2.15.0.


Log4j's JNDI support has not restricted what names could be resolved.

Some protocols are unsafe or can allow remote code execution. Log4j now
limits the protocols by default to only java, ldap, and ldaps and limits the 
ldap
protocols to only accessing Java primitive objects by default served on the
local host.


One vector that allowed exposure to this vulnerability was Log4j's

allowance of Lookups to appear in log messages. As of Log4j 2.15.0 this
feature is now disabled by default. While an option has been provided to
enable Lookups in this fashion, users are strongly discouraged from enabling
it.


For those who cannot upgrade to 2.15.0, in releases >=2.10, this behavior

can be mitigated by setting either the system property
log4j2.formatMsgNoLookups or the environment variable
LOG4J_FORMAT_MSG_NO_LOOKUPS to true. For releases >=2.7 and
<=2.14.1, all PatternLayout patterns can be modified to specify the message
converter as %m{nolookups} instead of just %m. For releases >=2.0-beta9
and <=2.10.0, the mitigation is to remove the JndiLookup class from the
classpath: zip -q -d log4j-core-*.jar
org/apache/logging/log4j/core/lookup/JndiLookup.class.



Fixed in Log4j 2.15.0

CVE-2021-44228<https://urldefense.com/v3/__https://cve.mitre.org/cgi-

bin/cvename.cgi?name=CVE-2021-
44228__;!!F9svGWnIaVPGSwU!74bXJbpgx_hbZXhDbugIcTGP5lu3n4862EH5m
3nzPf6zeN_vbTWY0WIHuhFmP_EenqW0-rM$ >: Apache Log4j2 JNDI
features do not protect against attacker controlled LDAP and other JNDI
related endpoints.


Severity: Critical

Base CVSS Score: 10.0 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Versions Affected: all log4j-core versions >=2.0-beta9 and <=2.14.1

Descripton: Apache Log4j <=2.14.1 JNDI features used in configuration, log

messages, and parameters do not protect against attacker controlled LDAP
and other JNDI related endpoints. An attacker who can control log messages
or log message parameters can execute arbitrary code loaded from LDAP
servers when message lookup substitution is enabled. From log4j 2.15.0, this
behavior has been disabled by default.


Mitigation: In releases >=2.10, this behavior can be mitigated by setting

either the system property log4j2.formatMsgNoLookups or the environment
variable LOG4J_FORMAT_MSG_NO_LOOKUPS to true. For releases >=2.7
and <=2.14.1, all PatternLayout patterns can be modified to specify the
message converter as %m{nolookups} instead of just %m. For releases

=2.0-beta9 and <=2.10.0, the mitigation is to remove the JndiLookup class

from the classpath: zip -q -d log4j-core-*.jar
org/apache/logging/log4j/core/lookup/JndiLookup.class.


Credit: This issue was discovered by Chen Zhaojun of Alibaba Cloud Security

Team.


References:


https://urldefense.com/v3/__https://issues.apache.org/jira/browse/LOG4

J2-

3201__;!!F9svGWnIaVPGSwU!74bXJbpgx_hbZXhDbugIcTGP5lu3n4862EH5m3
nzPf

6zeN_vbTWY0WIHuhFmP_EezMJYN6o$  and


https://urldefense.com/v3/__https://issues.apache.org/jira/browse/LOG4

J2-

3198__;!!F9svGWnIaVPGSwU!74bXJbpgx_hbZXhDbugIcTGP5lu3n4862EH5m3
nzPf

6zeN_vbTWY0WIHuhFmP_EenSYqOaM$

Thanks,

Dream * Excel * Explore * Inspire
Jon McAlexander
Infrastructure Engineer
Asst Vice President

Middleware Product Engineering
Enterprise CIO | EAS | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508



jonmcalexan...@wellsfargo.com<mailto:jonmcalexan...@wellsfargo.com>

This message may contain confidential and/or privileged information. If you

are not the addressee or authorized to receive this for the addressee, you
must not use, copy,

RE: log4j CVE general question

2021-12-13 Thread jonmcalexander
Ok, so I have been given clearance to share the stance that we are taking with 
log4j. We have contacted Apache Security and are awaiting a response.

Before making a final decision around log4j 1.x, consider the following:

-Initially, 1.x wasn’t assessed for the vulnerability, because, it is end of 
life, so many points of guidance did not assess it and exclude it from their 
advisories.  
-The situation with 1.x is morphing, modifications to the payload may result in 
RCE or server-side lookups, there are also circumstances were 1.x is vulnerable:
-Log4j 1.x may be impacted by CVE-2021-44228 in a number of conditions, such as 
when the configuration uses JNDI, which may have been enabled.
-It's possible to use the 1.x Appender to load strings from a remote server. If 
you sent TopicBindingName or TopicConnectionFactoryBindingName to values that 
JDNI can handle, which is a configuration issue that needs to be investigated 
by teams using 1.x, but a lower priority than the risk of 2.x exploitation 
which is not configuration-dependent.
-Log4j .x is End of Life, and has other security vulnerabilities that will not 
be fixed, i.e (CVE-2019-17571) that should be assessed when judging their risk.

Our recommendation is to migrate from 1.x as a P2 priority, behind your 2.x 
patching efforts. Migration guide: 
https://logging.apache.org/log4j/2.x/manual/migration.html

Thanks. Just trying to help and practice good stewardship in the Tomcat 
community. :-D

Dream * Excel * Explore * Inspire
Jon McAlexander
Infrastructure Engineer
Asst Vice President

Middleware Product Engineering
Enterprise CIO | EAS | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexan...@wellsfargo.com
This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.


> -Original Message-
> From: jonmcalexan...@wellsfargo.com.INVALID
> 
> Sent: Monday, December 13, 2021 11:48 AM
> To: users@tomcat.apache.org
> Subject: RE: log4j CVE general question
> 
> I understand Chris. I guess I was looking to see if he had contact info for
> anyone on that particular project. I know it's not like a "company".
> 
> Thanks though!
> 
> Dream * Excel * Explore * Inspire
> Jon McAlexander
> Infrastructure Engineer
> Asst Vice President
> 
> Middleware Product Engineering
> Enterprise CIO | EAS | Middleware | Infrastructure Solutions
> 
> 8080 Cobblestone Rd | Urbandale, IA 50322
> MAC: F4469-010
> Tel 515-988-2508 | Cell 515-988-2508
> 
> jonmcalexan...@wellsfargo.com
> This message may contain confidential and/or privileged information. If you
> are not the addressee or authorized to receive this for the addressee, you
> must not use, copy, disclose, or take any action based on this message or any
> information herein. If you have received this message in error, please advise
> the sender immediately by reply e-mail and delete this message. Thank you
> for your cooperation.
> 
> > -Original Message-
> > From: Christopher Schultz 
> > Sent: Monday, December 13, 2021 11:39 AM
> > To: users@tomcat.apache.org
> > Subject: Re: log4j CVE general question
> >
> > Jon,
> >
> > On 12/13/21 11:51, jonmcalexan...@wellsfargo.com.INVALID wrote:
> > > So, based on these entries on the log4j apache pages, I can't see
> > > that any 1x product is vulnerable. Mark, is there some message from
> > > Apache that we can share with those that need to know that for
> > > certain 1x log4j is NOT vulnerable?
> > This is not something the Tomcat team (or Mark, individually) can
> > really do for you.
> >
> > You should check for information from the log4j team.
> >
> > Unofficially, log4j 1.x does not seem to be affected. There were some
> > questions about configuring it for use with a JMS appender, but it
> > seems those issues would be limited to having a compromised JMS server
> > or an injection into JNDI from another (unrelated) exploit.
> >
> > -chris
> >
> >
> > >
> > >
> > > News
> > > CVE-2021-44228
> > >
> > > The Log4j team has been made aware of a security vulnerability,
> > > CVE-2021-
> > 44228, that has been addressed in Log4j 2.15.0.
> > >
> > > Log4j's JNDI support has not restricted what names could be resolved.
> > Some protocols are unsafe or can all

RE: log4j CVE general question

2021-12-13 Thread jonmcalexander
I understand Chris. I guess I was looking to see if he had contact info for 
anyone on that particular project. I know it's not like a "company". 

Thanks though!

Dream * Excel * Explore * Inspire
Jon McAlexander
Infrastructure Engineer
Asst Vice President

Middleware Product Engineering
Enterprise CIO | EAS | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexan...@wellsfargo.com
This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.

> -Original Message-
> From: Christopher Schultz 
> Sent: Monday, December 13, 2021 11:39 AM
> To: users@tomcat.apache.org
> Subject: Re: log4j CVE general question
> 
> Jon,
> 
> On 12/13/21 11:51, jonmcalexan...@wellsfargo.com.INVALID wrote:
> > So, based on these entries on the log4j apache pages, I can't see that
> > any 1x product is vulnerable. Mark, is there some message from Apache
> > that we can share with those that need to know that for certain 1x
> > log4j is NOT vulnerable?
> This is not something the Tomcat team (or Mark, individually) can really do
> for you.
> 
> You should check for information from the log4j team.
> 
> Unofficially, log4j 1.x does not seem to be affected. There were some
> questions about configuring it for use with a JMS appender, but it seems
> those issues would be limited to having a compromised JMS server or an
> injection into JNDI from another (unrelated) exploit.
> 
> -chris
> 
> 
> >
> >
> > News
> > CVE-2021-44228
> >
> > The Log4j team has been made aware of a security vulnerability, CVE-2021-
> 44228, that has been addressed in Log4j 2.15.0.
> >
> > Log4j's JNDI support has not restricted what names could be resolved.
> Some protocols are unsafe or can allow remote code execution. Log4j now
> limits the protocols by default to only java, ldap, and ldaps and limits the 
> ldap
> protocols to only accessing Java primitive objects by default served on the
> local host.
> >
> > One vector that allowed exposure to this vulnerability was Log4j's
> allowance of Lookups to appear in log messages. As of Log4j 2.15.0 this
> feature is now disabled by default. While an option has been provided to
> enable Lookups in this fashion, users are strongly discouraged from enabling
> it.
> >
> > For those who cannot upgrade to 2.15.0, in releases >=2.10, this behavior
> can be mitigated by setting either the system property
> log4j2.formatMsgNoLookups or the environment variable
> LOG4J_FORMAT_MSG_NO_LOOKUPS to true. For releases >=2.7 and
> <=2.14.1, all PatternLayout patterns can be modified to specify the message
> converter as %m{nolookups} instead of just %m. For releases >=2.0-beta9
> and <=2.10.0, the mitigation is to remove the JndiLookup class from the
> classpath: zip -q -d log4j-core-*.jar
> org/apache/logging/log4j/core/lookup/JndiLookup.class.
> >
> >
> > Fixed in Log4j 2.15.0
> >
> > CVE-2021-44228<https://urldefense.com/v3/__https://cve.mitre.org/cgi-
> bin/cvename.cgi?name=CVE-2021-
> 44228__;!!F9svGWnIaVPGSwU!74bXJbpgx_hbZXhDbugIcTGP5lu3n4862EH5m
> 3nzPf6zeN_vbTWY0WIHuhFmP_EenqW0-rM$ >: Apache Log4j2 JNDI
> features do not protect against attacker controlled LDAP and other JNDI
> related endpoints.
> >
> > Severity: Critical
> >
> > Base CVSS Score: 10.0 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
> >
> > Versions Affected: all log4j-core versions >=2.0-beta9 and <=2.14.1
> >
> > Descripton: Apache Log4j <=2.14.1 JNDI features used in configuration, log
> messages, and parameters do not protect against attacker controlled LDAP
> and other JNDI related endpoints. An attacker who can control log messages
> or log message parameters can execute arbitrary code loaded from LDAP
> servers when message lookup substitution is enabled. From log4j 2.15.0, this
> behavior has been disabled by default.
> >
> > Mitigation: In releases >=2.10, this behavior can be mitigated by setting
> either the system property log4j2.formatMsgNoLookups or the environment
> variable LOG4J_FORMAT_MSG_NO_LOOKUPS to true. For releases >=2.7
> and <=2.14.1, all PatternLayout patterns can be modified to specify the
> message converter as %m{nolookups} instead of just %m. For releases
> >

Re: log4j CVE general question

2021-12-13 Thread Christopher Schultz

Jon,

On 12/13/21 11:51, jonmcalexan...@wellsfargo.com.INVALID wrote:

So, based on these entries on the log4j apache pages, I can't see
that any 1x product is vulnerable. Mark, is there some message from
Apache that we can share with those that need to know that for
certain 1x log4j is NOT vulnerable?
This is not something the Tomcat team (or Mark, individually) can really 
do for you.


You should check for information from the log4j team.

Unofficially, log4j 1.x does not seem to be affected. There were some 
questions about configuring it for use with a JMS appender, but it seems 
those issues would be limited to having a compromised JMS server or an 
injection into JNDI from another (unrelated) exploit.


-chris





News
CVE-2021-44228

The Log4j team has been made aware of a security vulnerability, CVE-2021-44228, 
that has been addressed in Log4j 2.15.0.

Log4j's JNDI support has not restricted what names could be resolved. Some 
protocols are unsafe or can allow remote code execution. Log4j now limits the 
protocols by default to only java, ldap, and ldaps and limits the ldap 
protocols to only accessing Java primitive objects by default served on the 
local host.

One vector that allowed exposure to this vulnerability was Log4j's allowance of 
Lookups to appear in log messages. As of Log4j 2.15.0 this feature is now 
disabled by default. While an option has been provided to enable Lookups in 
this fashion, users are strongly discouraged from enabling it.

For those who cannot upgrade to 2.15.0, in releases >=2.10, this behavior can be mitigated 
by setting either the system property log4j2.formatMsgNoLookups or the environment variable 
LOG4J_FORMAT_MSG_NO_LOOKUPS to true. For releases >=2.7 and <=2.14.1, all PatternLayout 
patterns can be modified to specify the message converter as %m{nolookups} instead of just %m. 
For releases >=2.0-beta9 and <=2.10.0, the mitigation is to remove the JndiLookup class 
from the classpath: zip -q -d log4j-core-*.jar 
org/apache/logging/log4j/core/lookup/JndiLookup.class.


Fixed in Log4j 2.15.0

CVE-2021-44228: 
Apache Log4j2 JNDI features do not protect against attacker controlled LDAP and other 
JNDI related endpoints.

Severity: Critical

Base CVSS Score: 10.0 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Versions Affected: all log4j-core versions >=2.0-beta9 and <=2.14.1

Descripton: Apache Log4j <=2.14.1 JNDI features used in configuration, log 
messages, and parameters do not protect against attacker controlled LDAP and other 
JNDI related endpoints. An attacker who can control log messages or log message 
parameters can execute arbitrary code loaded from LDAP servers when message lookup 
substitution is enabled. From log4j 2.15.0, this behavior has been disabled by 
default.

Mitigation: In releases >=2.10, this behavior can be mitigated by setting either the system 
property log4j2.formatMsgNoLookups or the environment variable LOG4J_FORMAT_MSG_NO_LOOKUPS to 
true. For releases >=2.7 and <=2.14.1, all PatternLayout patterns can be modified to 
specify the message converter as %m{nolookups} instead of just %m. For releases >=2.0-beta9 
and <=2.10.0, the mitigation is to remove the JndiLookup class from the classpath: zip -q 
-d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class.

Credit: This issue was discovered by Chen Zhaojun of Alibaba Cloud Security 
Team.

References: https://issues.apache.org/jira/browse/LOG4J2-3201 and 
https://issues.apache.org/jira/browse/LOG4J2-3198

Thanks,

Dream * Excel * Explore * Inspire
Jon McAlexander
Infrastructure Engineer
Asst Vice President

Middleware Product Engineering
Enterprise CIO | EAS | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexan...@wellsfargo.com
This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
More test info trying to isolate the problem:
Task:
  developing  web app project on eclipse 2019 version. main project
includes a dependent project (sub-project) on the same eclipse.

Run main app as java app:
  main app vm parameters include: -Dlog4j.configurationFile,
LogManager.getLogger() returns correct logger in main app as well as
sub-project code. meaning, Log4j2 messages can print as expected. no error.

Run web app on tomcat 9, 8 or 7:
For tomcat runtime classpath, eclipse requires to add the sub-project and
all the jars needed (include log4j2 jars), otherwise it complains with no
class found error. However, after log4j2 jars are added, it throws the
above " ERROR StatusLogger Unrecognized format specifier " errors. The web
app can run. Log4j2 messages can print in the main app codes. BUT, Logger
in the sub-project codes does not print messages because it has error.

The cause may be in tomcat or in log4j2, or even eclipse. Any idea?

thanks,
-aj



On Fri, May 8, 2020 at 11:21 AM AJ Chen  wrote:

> Hi Mark,
> I also use log4j2 in my web app. dev in eclipse, when adding the log4j2
> jars to tomcat 7,8, or 9 runtime, it has this problem, log4j2.xml is
> provided as VM parameter. Web app firsts instantiates log4j2, and then
> tries to config log4j2 again,  throwing the following error due to double
> class loading:
>
> ERROR StatusLogger Unrecognized format specifier [d]
> ERROR StatusLogger Unrecognized conversion specifier [d] starting at
> position 16 in conversion pattern.
> ERROR StatusLogger Unrecognized format specifier [thread]
> ERROR StatusLogger Unrecognized conversion specifier [thread] starting at
> position 25 in conversion pattern.
> ERROR StatusLogger Unrecognized format specifier [level]
> ERROR StatusLogger Unrecognized conversion specifier [level] starting at
> position 35 in conversion pattern.
> ERROR StatusLogger Unrecognized format specifier [logger]
> ERROR StatusLogger Unrecognized conversion specifier [logger] starting at
> position 47 in conversion pattern.
> ERROR StatusLogger Unrecognized format specifier [msg]
> ERROR StatusLogger Unrecognized conversion specifier [msg] starting at
> position 54 in conversion pattern.
> ERROR StatusLogger Unrecognized format specifier [n]
> ERROR StatusLogger Unrecognized conversion specifier [n] starting at
> position 56 in conversion pattern.
> ERROR StatusLogger Reconfiguration failed: No configuration found for
> '18b4aac2' at 'null' in 'null'
>
> Please note there is problem in the simple log4j2.xml for testing, which
> can be loaded successfully when there is no double class loading.
>
> -aj
>
>
> On Thu, May 7, 2020 at 1:53 PM Mark Thomas  wrote:
>
>> On 07/05/2020 21:40, AJ Chen wrote:
>> > I use eclipse to develop web app for tomcat, Web app has a dependent
>> > project and so the dependent project and all jars are added on the
>> > classpath for tomcat runtime. Log4j works on tomcat 6. But after
>> upgrate to
>> > tomcat 9, log4j failed to start with the following error. Anyone has
>> seen
>> > similar problem? log4j2 also failed. Thanks.
>>
>> Note: log4j is no longer supported.
>>
>> How, exactly, is log4j configured? What JAR files and what configuration
>> files are where? Any other configuration?
>>
>> Mark
>>
>>
>> >
>> > log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not
>> > assignable to a "org.apache.log4j.Appender" variable.
>> > log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
>> > log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas object
>> of
>> > type
>> > log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by
>> > [ParallelWebappClassLoader
>> >
>> > aj
>> >
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>


Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
Hi Mark,
I also use log4j2 in my web app. dev in eclipse, when adding the log4j2
jars to tomcat 7,8, or 9 runtime, it has this problem, log4j2.xml is
provided as VM parameter. Web app firsts instantiates log4j2, and then
tries to config log4j2 again,  throwing the following error due to double
class loading:

ERROR StatusLogger Unrecognized format specifier [d]
ERROR StatusLogger Unrecognized conversion specifier [d] starting at
position 16 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [thread]
ERROR StatusLogger Unrecognized conversion specifier [thread] starting at
position 25 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [level]
ERROR StatusLogger Unrecognized conversion specifier [level] starting at
position 35 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [logger]
ERROR StatusLogger Unrecognized conversion specifier [logger] starting at
position 47 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [msg]
ERROR StatusLogger Unrecognized conversion specifier [msg] starting at
position 54 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [n]
ERROR StatusLogger Unrecognized conversion specifier [n] starting at
position 56 in conversion pattern.
ERROR StatusLogger Reconfiguration failed: No configuration found for
'18b4aac2' at 'null' in 'null'

Please note there is problem in the simple log4j2.xml for testing, which
can be loaded successfully when there is no double class loading.

-aj


On Thu, May 7, 2020 at 1:53 PM Mark Thomas  wrote:

> On 07/05/2020 21:40, AJ Chen wrote:
> > I use eclipse to develop web app for tomcat, Web app has a dependent
> > project and so the dependent project and all jars are added on the
> > classpath for tomcat runtime. Log4j works on tomcat 6. But after upgrate
> to
> > tomcat 9, log4j failed to start with the following error. Anyone has seen
> > similar problem? log4j2 also failed. Thanks.
>
> Note: log4j is no longer supported.
>
> How, exactly, is log4j configured? What JAR files and what configuration
> files are where? Any other configuration?
>
> Mark
>
>
> >
> > log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not
> > assignable to a "org.apache.log4j.Appender" variable.
> > log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> > log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas object
> of
> > type
> > log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by
> > [ParallelWebappClassLoader
> >
> > aj
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
Hi Chris,
my web app META-INF/lib has log4j jar,  but CATALINA_BASE/lib does not have
log4j jar listed.
It should be double loading class issue. I need to find out how to exclude
the unwanted classloading.
-aj


On Thu, May 7, 2020 at 2:48 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> AJ,
>
> On 5/7/20 16:40, AJ Chen wrote:
> > I use eclipse to develop web app for tomcat, Web app has a
> > dependent project and so the dependent project and all jars are
> > added on the classpath for tomcat runtime. Log4j works on tomcat 6.
> > But after upgrate to tomcat 9, log4j failed to start with the
> > following error. Anyone has seen similar problem? log4j2 also
> > failed. Thanks.
> >
> > log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is
> > not assignable to a "org.apache.log4j.Appender" variable.
> > log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> > log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas
> > object of type log4j:ERROR
> > "org.apache.log4j.DailyRollingFileAppender" was loaded by
> > [ParallelWebappClassLoader
>
> Can I just say that the above is a masterpiece of diagnostic error
> messaging?
>
> I can already tell that you have a classloading issue, and it's almost
> certain that you have log4j.jar both in CATALINA_BASE/lib and your web
> application's META-INF/lib directory. Is that the case?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl60gjsACgkQHPApP6U8
> pFgydxAAvnJ1tJFklOMnsHnx+gFn7m0UkWjs1Sj+1zurmjuAzd64aXjwt8Mh2FRH
> JaJ4R0kYaHruoJxNDKelS+FIYgn1qe7D7LE7uq6gmNHg5b1JruoUXbk2GcaTfM55
> htu9idB/JOyx5lmlP4tR6E/K7HctM6h2A7zuJ2s98VM2WljU/Ts6v5R1C53JbXq6
> gzB0g6XYyVnuQx/9qoSyOSqKIBp3jLp2G8JlKje7SzKZcJeXSzq0HPUX6Do15VK1
> Rl8ineKRjwDHgujjN3DiXqh+BnbdY6URsFApwGVxNLqh/ykIQYIHVxCGuRv9+W3D
> i0Uxx9C2p6rb6Nr8Tk6lxZjx1IMCC0JuKaunHPt6bQ26s/VNEROU5aztQ5RF/ynN
> pjFvwa/UIR6/i5u7mtGo2WBRLmH04KOu/7ZS8FL4ieKHXuaGGDvZlTe3AZ8hBPNx
> 2jHtmpqWiQaw1+lMnL7RxrmGBISIWSH4+MAKXWDzM4OSeTsKxTv2gcZ14Z9HfYZm
> JGO3DGgOSfWAnFSTYX9L/NodRfIDXLMPTAG/epWzSSiF5tf6nAzWNj6Vbi1L0VnS
> 8IdfqHavSGeIqhDqwTSwuQhXYdoc6AyBdY5WIYEGiUNu789b9SjNlY8/EWqjrJKx
> 3Au9YxYkMTqi2SL/r1cCd8HU+imS9L3aSZPKaOn73AsTtux/VCA=
> =IVj+
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: log4j failed on tomcat9

2020-05-08 Thread AJ Chen
Hi Luis, good blog for logging settings. thanks.
-aj


On Thu, May 7, 2020 at 11:42 PM Luis Rodríguez Fernández 
wrote:

> Hello AjChen,
>
> Here [1] you can find an example of how I configured log4j2 in tomcat 9.
> You can skip all the bla, bla, bla and go directly to the gitthub repo [2]
> and run the example to have a look at the configuration.
>
> Note: I've been running like this for a while in production, but I do think
> that I am going to come back to the default, beautiful and simple JULI :)
>
> Hope it helps,
>
> Luis
>
> [1]
>
> https://db-blog.web.cern.ch/blog/luis-rodriguez-fernandez/2019-03-keeping-your-logs-clean-apache-tomcat-9-log4j2-and-spring-boot
> [2] https://github.com/lurodrig/log4j2-in-tomcat/
>
> El jue., 7 may. 2020 a las 23:48, Christopher Schultz (<
> ch...@christopherschultz.net>) escribió:
>
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA256
> >
> > AJ,
> >
> > On 5/7/20 16:40, AJ Chen wrote:
> > > I use eclipse to develop web app for tomcat, Web app has a
> > > dependent project and so the dependent project and all jars are
> > > added on the classpath for tomcat runtime. Log4j works on tomcat 6.
> > > But after upgrate to tomcat 9, log4j failed to start with the
> > > following error. Anyone has seen similar problem? log4j2 also
> > > failed. Thanks.
> > >
> > > log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is
> > > not assignable to a "org.apache.log4j.Appender" variable.
> > > log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> > > log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas
> > > object of type log4j:ERROR
> > > "org.apache.log4j.DailyRollingFileAppender" was loaded by
> > > [ParallelWebappClassLoader
> >
> > Can I just say that the above is a masterpiece of diagnostic error
> > messaging?
> >
> > I can already tell that you have a classloading issue, and it's almost
> > certain that you have log4j.jar both in CATALINA_BASE/lib and your web
> > application's META-INF/lib directory. Is that the case?
> >
> > - -chris
> > -BEGIN PGP SIGNATURE-
> > Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> >
> > iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl60gjsACgkQHPApP6U8
> > pFgydxAAvnJ1tJFklOMnsHnx+gFn7m0UkWjs1Sj+1zurmjuAzd64aXjwt8Mh2FRH
> > JaJ4R0kYaHruoJxNDKelS+FIYgn1qe7D7LE7uq6gmNHg5b1JruoUXbk2GcaTfM55
> > htu9idB/JOyx5lmlP4tR6E/K7HctM6h2A7zuJ2s98VM2WljU/Ts6v5R1C53JbXq6
> > gzB0g6XYyVnuQx/9qoSyOSqKIBp3jLp2G8JlKje7SzKZcJeXSzq0HPUX6Do15VK1
> > Rl8ineKRjwDHgujjN3DiXqh+BnbdY6URsFApwGVxNLqh/ykIQYIHVxCGuRv9+W3D
> > i0Uxx9C2p6rb6Nr8Tk6lxZjx1IMCC0JuKaunHPt6bQ26s/VNEROU5aztQ5RF/ynN
> > pjFvwa/UIR6/i5u7mtGo2WBRLmH04KOu/7ZS8FL4ieKHXuaGGDvZlTe3AZ8hBPNx
> > 2jHtmpqWiQaw1+lMnL7RxrmGBISIWSH4+MAKXWDzM4OSeTsKxTv2gcZ14Z9HfYZm
> > JGO3DGgOSfWAnFSTYX9L/NodRfIDXLMPTAG/epWzSSiF5tf6nAzWNj6Vbi1L0VnS
> > 8IdfqHavSGeIqhDqwTSwuQhXYdoc6AyBdY5WIYEGiUNu789b9SjNlY8/EWqjrJKx
> > 3Au9YxYkMTqi2SL/r1cCd8HU+imS9L3aSZPKaOn73AsTtux/VCA=
> > =IVj+
> > -END PGP SIGNATURE-
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
>
> --
>
> "Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."
>
> - Samuel Beckett
>


Re: log4j failed on tomcat9

2020-05-08 Thread Luis Rodríguez Fernández
Hello AjChen,

Here [1] you can find an example of how I configured log4j2 in tomcat 9.
You can skip all the bla, bla, bla and go directly to the gitthub repo [2]
and run the example to have a look at the configuration.

Note: I've been running like this for a while in production, but I do think
that I am going to come back to the default, beautiful and simple JULI :)

Hope it helps,

Luis

[1]
https://db-blog.web.cern.ch/blog/luis-rodriguez-fernandez/2019-03-keeping-your-logs-clean-apache-tomcat-9-log4j2-and-spring-boot
[2] https://github.com/lurodrig/log4j2-in-tomcat/

El jue., 7 may. 2020 a las 23:48, Christopher Schultz (<
ch...@christopherschultz.net>) escribió:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> AJ,
>
> On 5/7/20 16:40, AJ Chen wrote:
> > I use eclipse to develop web app for tomcat, Web app has a
> > dependent project and so the dependent project and all jars are
> > added on the classpath for tomcat runtime. Log4j works on tomcat 6.
> > But after upgrate to tomcat 9, log4j failed to start with the
> > following error. Anyone has seen similar problem? log4j2 also
> > failed. Thanks.
> >
> > log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is
> > not assignable to a "org.apache.log4j.Appender" variable.
> > log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> > log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas
> > object of type log4j:ERROR
> > "org.apache.log4j.DailyRollingFileAppender" was loaded by
> > [ParallelWebappClassLoader
>
> Can I just say that the above is a masterpiece of diagnostic error
> messaging?
>
> I can already tell that you have a classloading issue, and it's almost
> certain that you have log4j.jar both in CATALINA_BASE/lib and your web
> application's META-INF/lib directory. Is that the case?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl60gjsACgkQHPApP6U8
> pFgydxAAvnJ1tJFklOMnsHnx+gFn7m0UkWjs1Sj+1zurmjuAzd64aXjwt8Mh2FRH
> JaJ4R0kYaHruoJxNDKelS+FIYgn1qe7D7LE7uq6gmNHg5b1JruoUXbk2GcaTfM55
> htu9idB/JOyx5lmlP4tR6E/K7HctM6h2A7zuJ2s98VM2WljU/Ts6v5R1C53JbXq6
> gzB0g6XYyVnuQx/9qoSyOSqKIBp3jLp2G8JlKje7SzKZcJeXSzq0HPUX6Do15VK1
> Rl8ineKRjwDHgujjN3DiXqh+BnbdY6URsFApwGVxNLqh/ykIQYIHVxCGuRv9+W3D
> i0Uxx9C2p6rb6Nr8Tk6lxZjx1IMCC0JuKaunHPt6bQ26s/VNEROU5aztQ5RF/ynN
> pjFvwa/UIR6/i5u7mtGo2WBRLmH04KOu/7ZS8FL4ieKHXuaGGDvZlTe3AZ8hBPNx
> 2jHtmpqWiQaw1+lMnL7RxrmGBISIWSH4+MAKXWDzM4OSeTsKxTv2gcZ14Z9HfYZm
> JGO3DGgOSfWAnFSTYX9L/NodRfIDXLMPTAG/epWzSSiF5tf6nAzWNj6Vbi1L0VnS
> 8IdfqHavSGeIqhDqwTSwuQhXYdoc6AyBdY5WIYEGiUNu789b9SjNlY8/EWqjrJKx
> 3Au9YxYkMTqi2SL/r1cCd8HU+imS9L3aSZPKaOn73AsTtux/VCA=
> =IVj+
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett


Re: log4j failed on tomcat9

2020-05-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

AJ,

On 5/7/20 16:40, AJ Chen wrote:
> I use eclipse to develop web app for tomcat, Web app has a
> dependent project and so the dependent project and all jars are
> added on the classpath for tomcat runtime. Log4j works on tomcat 6.
> But after upgrate to tomcat 9, log4j failed to start with the
> following error. Anyone has seen similar problem? log4j2 also
> failed. Thanks.
>
> log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is
> not assignable to a "org.apache.log4j.Appender" variable.
> log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas
> object of type log4j:ERROR
> "org.apache.log4j.DailyRollingFileAppender" was loaded by
> [ParallelWebappClassLoader

Can I just say that the above is a masterpiece of diagnostic error
messaging?

I can already tell that you have a classloading issue, and it's almost
certain that you have log4j.jar both in CATALINA_BASE/lib and your web
application's META-INF/lib directory. Is that the case?

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl60gjsACgkQHPApP6U8
pFgydxAAvnJ1tJFklOMnsHnx+gFn7m0UkWjs1Sj+1zurmjuAzd64aXjwt8Mh2FRH
JaJ4R0kYaHruoJxNDKelS+FIYgn1qe7D7LE7uq6gmNHg5b1JruoUXbk2GcaTfM55
htu9idB/JOyx5lmlP4tR6E/K7HctM6h2A7zuJ2s98VM2WljU/Ts6v5R1C53JbXq6
gzB0g6XYyVnuQx/9qoSyOSqKIBp3jLp2G8JlKje7SzKZcJeXSzq0HPUX6Do15VK1
Rl8ineKRjwDHgujjN3DiXqh+BnbdY6URsFApwGVxNLqh/ykIQYIHVxCGuRv9+W3D
i0Uxx9C2p6rb6Nr8Tk6lxZjx1IMCC0JuKaunHPt6bQ26s/VNEROU5aztQ5RF/ynN
pjFvwa/UIR6/i5u7mtGo2WBRLmH04KOu/7ZS8FL4ieKHXuaGGDvZlTe3AZ8hBPNx
2jHtmpqWiQaw1+lMnL7RxrmGBISIWSH4+MAKXWDzM4OSeTsKxTv2gcZ14Z9HfYZm
JGO3DGgOSfWAnFSTYX9L/NodRfIDXLMPTAG/epWzSSiF5tf6nAzWNj6Vbi1L0VnS
8IdfqHavSGeIqhDqwTSwuQhXYdoc6AyBdY5WIYEGiUNu789b9SjNlY8/EWqjrJKx
3Au9YxYkMTqi2SL/r1cCd8HU+imS9L3aSZPKaOn73AsTtux/VCA=
=IVj+
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j failed on tomcat9

2020-05-07 Thread Mark Thomas
On 07/05/2020 21:40, AJ Chen wrote:
> I use eclipse to develop web app for tomcat, Web app has a dependent
> project and so the dependent project and all jars are added on the
> classpath for tomcat runtime. Log4j works on tomcat 6. But after upgrate to
> tomcat 9, log4j failed to start with the following error. Anyone has seen
> similar problem? log4j2 also failed. Thanks.

Note: log4j is no longer supported.

How, exactly, is log4j configured? What JAR files and what configuration
files are where? Any other configuration?

Mark


> 
> log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not
> assignable to a "org.apache.log4j.Appender" variable.
> log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> log4j:ERROR [sun.misc.Launcher$AppClassLoader@18b4aac2] whereas object of
> type
> log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by
> [ParallelWebappClassLoader
> 
> aj
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: log4j app logging

2019-01-07 Thread Lemke, Michael ST/HZA-ZIC2
On Thursday, December 27, 2018 5:35 PM, Mark H. Wood wrote:
>On Wed, Dec 19, 2018 at 06:52:20PM +, Lemke, Michael  ST/HZA-ZIC2 wrote:
>> On December 19, 2018 6:54 PM Lemke, Michael wrote:
>> >On December 18, 2018 8:52 PM Christopher Schultz wrote:
>> >>On 12/18/18 12:42, Lemke, Michael  ST/HZA-ZIC2 wrote:
>> >>> I have an old webapp that uses log4j 1.2 and which I am trying to 
>> >>> deploy on tomcat. For the heck of it I can't get tomcat to use the 
>> >>> log4.properties file. What am I doing wrong?
>> >>
>> >>
...
>> >I guess I have a terrible mess of all sorts of loggers in my libraries. I am
>> >not good at all the different Java loggers. The log4j.properties I want 
>> >to use is for log4j-1.2.27 so not quite bleeding edge ??. Then there are 
>> >other libs that pull in slf4j-api-1.7.25.jar, there is a 
>> >jcl-over-slf4j-1.7.25.jar, 
>> >logback-classic-1.2.3.jar, logback-core-1.2.3.jar.
>> >
>
>If this happens to be a project built with Maven then 'mvn
>dependency:tree' should tell you which artifacts are pulling in
>SLF4J.  You may need to run this more than once as you comb out
>transitive dependencies one by one.
>
>But it's possible to use multiple logging frameworks in one webapp. if
>you include/exclude the right artifacts.  See
>https://www.slf4j.org/legacy.html if you need to do this with SLF4J
>and Log4J v1.

Thank you very much, Mark, this was very helpful. With it I could clean up the 
mess. 
Most important part was to get rid of logback-* and switch everything to slf4j
with the help of slf4j-log4j12. Now everything seems to be working.

Thanks again,
Michael

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j app logging

2018-12-27 Thread Mark H. Wood
On Wed, Dec 19, 2018 at 06:52:20PM +, Lemke, Michael  ST/HZA-ZIC2 wrote:
> On December 19, 2018 6:54 PM Lemke, Michael wrote:
> >On December 18, 2018 8:52 PM Christopher Schultz wrote:
> >>On 12/18/18 12:42, Lemke, Michael  ST/HZA-ZIC2 wrote:
> >>> I have an old webapp that uses log4j 1.2 and which I am trying to 
> >>> deploy on tomcat. For the heck of it I can't get tomcat to use the 
> >>> log4.properties file. What am I doing wrong?
> >>
> >>
> >>How are you initializing log4j?
> >
> >Good question. I just dug a little and have to say I don't know. It
> >is a myfaces 1.1 application and I just realized jsf  has logging built
> >in somehow. I can't find any explicit call to Logger.getLogger in the 
> >code. 
> >
> >I guess I have a terrible mess of all sorts of loggers in my libraries. I am
> >not good at all the different Java loggers. The log4j.properties I want 
> >to use is for log4j-1.2.27 so not quite bleeding edge ??. Then there are 
> >other libs that pull in slf4j-api-1.7.25.jar, there is a 
> >jcl-over-slf4j-1.7.25.jar, 
> >logback-classic-1.2.3.jar, logback-core-1.2.3.jar.
> >
> >Well, I do get quite lot of logging from the app in the tomcat logfiles, so
> >something is working. But I don't know how to configure it.
> >
> >This used to work when I ran it on resin but I also changed quite a bit on
> >the code when I switched to tomcat. I'll try without all the new stuff.
> 
> And this was it. The old version without the stuff that pulls in all the other
> log libraries it works. So tomcat is out of the loop. Sorry for the noise.
> (But if someone has a hint on my mess I wouldn't mind.)

If this happens to be a project built with Maven then 'mvn
dependency:tree' should tell you which artifacts are pulling in
SLF4J.  You may need to run this more than once as you comb out
transitive dependencies one by one.

But it's possible to use multiple logging frameworks in one webapp. if
you include/exclude the right artifacts.  See
https://www.slf4j.org/legacy.html if you need to do this with SLF4J
and Log4J v1.

-- 
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu


signature.asc
Description: PGP signature


RE: log4j app logging

2018-12-19 Thread Lemke, Michael ST/HZA-ZIC2
On December 19, 2018 6:54 PM Lemke, Michael wrote:
>On December 18, 2018 8:52 PM Christopher Schultz wrote:
>>On 12/18/18 12:42, Lemke, Michael  ST/HZA-ZIC2 wrote:
>>> I have an old webapp that uses log4j 1.2 and which I am trying to 
>>> deploy on tomcat. For the heck of it I can't get tomcat to use the 
>>> log4.properties file. What am I doing wrong?
>>
>>
>>How are you initializing log4j?
>
>Good question. I just dug a little and have to say I don't know. It
>is a myfaces 1.1 application and I just realized jsf  has logging built
>in somehow. I can't find any explicit call to Logger.getLogger in the 
>code. 
>
>I guess I have a terrible mess of all sorts of loggers in my libraries. I am
>not good at all the different Java loggers. The log4j.properties I want 
>to use is for log4j-1.2.27 so not quite bleeding edge ??. Then there are 
>other libs that pull in slf4j-api-1.7.25.jar, there is a 
>jcl-over-slf4j-1.7.25.jar, 
>logback-classic-1.2.3.jar, logback-core-1.2.3.jar.
>
>Well, I do get quite lot of logging from the app in the tomcat logfiles, so
>something is working. But I don't know how to configure it.
>
>This used to work when I ran it on resin but I also changed quite a bit on
>the code when I switched to tomcat. I'll try without all the new stuff.

And this was it. The old version without the stuff that pulls in all the other
log libraries it works. So tomcat is out of the loop. Sorry for the noise.
(But if someone has a hint on my mess I wouldn't mind.)

Thanks,
Michael

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: log4j app logging

2018-12-19 Thread Lemke, Michael ST/HZA-ZIC2
Christopher,

On December 18, 2018 8:52 PM Christopher Schultz wrote:
>On 12/18/18 12:42, Lemke, Michael  ST/HZA-ZIC2 wrote:
>> I have an old webapp that uses log4j 1.2 and which I am trying to 
>> deploy on tomcat. For the heck of it I can't get tomcat to use the 
>> log4.properties file. What am I doing wrong?
>
>Are you trying to get Tomcat to use the log4j.properties file from
>your application? 

No, this is not what I want to do.

>If so, that's not going to work, because Tomcagt
>starts up long before your application is loaded, and so the log4j.jar
>file and log4j.properties file are not used at all.
>
>Your *application* should be able to use log4j without any problems as
>long as the log4j.jar file is in WEB-INB/lib and your log4j.properties
>file is in (usually) WEB-INF/classes/log4j.properties.

Right, I want my application to use its log4j.properties.

>
>> tomcat 9.0.6 is installed as a Windows service and does serve my 
>> webapp, so the app is working fine. The project is mavenized, I
>> put log4.properties to src/main/resources and it ends up in the jar
>> file of my application. Is there anything special that needs to be
>> done?
>
>How are you initializing log4j?

Good question. I just dug a little and have to say I don't know. It
is a myfaces 1.1 application and I just realized jsf  has logging built
in somehow. I can't find any explicit call to Logger.getLogger in the 
code. 

I guess I have a terrible mess of all sorts of loggers in my libraries. I am
not good at all the different Java loggers. The log4j.properties I want 
to use is for log4j-1.2.27 so not quite bleeding edge . Then there are 
other libs that pull in slf4j-api-1.7.25.jar, there is a 
jcl-over-slf4j-1.7.25.jar, 
logback-classic-1.2.3.jar, logback-core-1.2.3.jar.

Well, I do get quite lot of logging from the app in the tomcat logfiles, so
something is working. But I don't know how to configure it.

This used to work when I ran it on resin but I also changed quite a bit on
the code when I switched to tomcat. I'll try without all the new stuff.

Thanks,
Michael

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j app logging

2018-12-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Michael,

On 12/18/18 13:53, Lemke, Michael  ST/HZA-ZIC2 wrote:
> Thanks, Ryan, this JULI thing actually is what worries me. I don't
> care about tomcat's logging at the moment. It is my webapp's
> logging I can't figure out. It worked on other containers.

Oh, good: you are trying just to manage your own application's logging.

I have this class running as a ServletContextListener:

package xxx;

import javax.servlet.ServletContextListener;
import javax.servlet.ServletContextEvent;

import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.Logger;
import org.apache.log4j.LogManager;

/**
 * A listener to initialize log4j.
 *
 * @author Chris Schultz
 * @version $Revision: 17834 $ $Date: 2015-12-16 11:03:13 -0500 (Wed,
16 Dec 2015) $
 */
public class Log4jListener
implements ServletContextListener
{
private Logger logger;

@SuppressWarnings("unused")
public void contextInitialized(ServletContextEvent e)
{
// Trigger loading of the log4j.properties file from the
classpath.
new PropertyConfigurator();

logger = Logger.getLogger(this.getClass());

logger.info("Log4j initialized");
}

public void contextDestroyed(ServletContextEvent e)
{
if(LogManager.class.getClassLoader()
   .equals(this.getClass().getClassLoader()))
{
if(null != logger)
logger.info("Log4j was loaded by application
classloader; shutting down.");

LogManager.shutdown();
}
else
{
if(null != logger)
logger.info("Log4j was loaded by some other
ClassLoader; not shutting down.");
}
}
}

Calling the PropertyConfigurator constructor causes that class to look
for log4j.properties in various places, including (due to the way the
WebappClassLoader works), WEB-INF/classes. It should also look in the
"top-level" of any application JAR files that are in WEB-INF/lib.

You said that "your JAR file contains log4j.properties". Usually
applications are packaged as WAR files (or exploded WAR directories).
Are you using embedded Tomcat or Spring Boot or anything like that?
Where is your JAR file located?

- -chris

> -Original Message- From: Ryan Palmer Sent: Tuesday,
> December 18, 2018 7:49 PM
> 
> Michael,
> 
> Tomcat uses JULI internally. Have you taken necessary steps to
> redirect JULI to log4j?
> 
> Thanks, Ryan
> 
>  From: Lemke, Michael ST/HZA-ZIC2
>  Sent: Tuesday, December 18, 2018 10:20
> AM To: Tomcat Users List Subject: RE: log4j app logging
> 
> On December 18, 2018 6:59 PM Ryan Palmer wrote:
>> 
>> The file needs to be named
>> log4j.properties<http://log4j.properties> (or .xml, .json, etc.)
>> and needs to be in the classpath. You ommitted the 'j'.
> 
> Thanks for spotting this. Unfortunately, this typo was only in the
> email:
> 
> pc# ls src/main/resources/ com  log4j.properties
> 
> 
> So for being in the classpath it is sufficient to have it packaged
> in the jar, isn't it?
> 
> Archive:  myapp-1.1.0-SNAPSHOT.jar Length   MethodSize  Cmpr
> DateTime   CRC-32   Name   --  --- 
> -- -    0  Stored0   0% 12-18-2018
> 16:56   META-INF/ 98  Defl:N   91   7% 12-18-2018 16:56
> 48730e36  META-INF/MANIFEST.MF 0  Stored0   0% 12-18-2018
> 16:56   META-INF/maven/ ... 0  Stored0   0%
> 12-18-2018 16:56   com/ ... 1123  Defl:N  451  60%
> 12-18-2018 16:56 eea5d81a  log4j.properties
> 
> It ought to be something simple but before further digging into my
> setup details I want to make sure there isn't something special for
> tomcat. Something in ${catalina.base}/conf or conflicts with
> tomcat's logging system.
> 
> 
>> On Dec 18, 2018, at 9:42 AM, "Lemke, Michael ST/HZA-ZIC2" wrote:
>> 
>> I have an old webapp that uses log4j 1.2 and which I am trying to
>> deploy on tomcat. For the heck of it I can't get tomcat to use
>> the log4.properties<http://log4.properties> file. What am I doing
>> wrong?
>> 
>> tomcat 9.0.6 is installed as a Windows service and does serve my
>> webapp, so the app is working fine. The project is mavenized, I
>> put log4.properties<http://log4.properties> to src/main/resources
>> and it ends up in the jar file of my application. Is there
>> anything special that needs to be done?
>> 
>> 
>> 
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For
>> additional commands, e-mail: users-h...@tomcat.apache.org
>> 
> 
> -

Re: log4j app logging

2018-12-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Michael,

On 12/18/18 12:42, Lemke, Michael  ST/HZA-ZIC2 wrote:
> I have an old webapp that uses log4j 1.2 and which I am trying to 
> deploy on tomcat. For the heck of it I can't get tomcat to use the 
> log4.properties file. What am I doing wrong?

Are you trying to get Tomcat to use the log4j.properties file from
your application? If so, that's not going to work, because Tomcagt
starts up long before your application is loaded, and so the log4j.jar
file and log4j.properties file are not used at all.

Your *application* should be able to use log4j without any problems as
long as the log4j.jar file is in WEB-INB/lib and your log4j.properties
file is in (usually) WEB-INF/classes/log4j.properties.

> tomcat 9.0.6 is installed as a Windows service and does serve my 
> webapp, so the app is working fine. The project is mavenized, I
> put log4.properties to src/main/resources and it ends up in the jar
> file of my application. Is there anything special that needs to be
> done?

How are you initializing log4j?

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlwZT8kACgkQHPApP6U8
pFjhkxAAi2N30jbKuENmuYhCVq6mlN2N0r8BQcNBhS6fx36DqLQd8V4/BRMQ3Y7+
o/mD1iG+2oGyovocdjspYgFD98dPoL4crUkhrWdc+FUJU7+M64zs7pwfvEnEpdQo
XXp4H15XYOfUT3IyqWuuxoOuX7AHwKfGvUoKSapiGxCWWGsW8LUVcWpec+Ow+oKu
7jd6Tc7xPMqvWpMHKJ/MoamU0BaxpE774BJSz7QJKu7tb/flSykc08vUVxGPg/9X
tfqbiQ8RbzP8Y7UFdDmbySPhK/+VpbwU7ljx5/detNshxZZrEwjKSU3udS/A9bxi
pHkM3gPbtyN/L9VLwaAF1LlxqYolkOqJRuGrw9hRtU5ihydyd7C3Du7T6CpWLSRn
WQ2UTEVwSMJl2y+FF+nKs2o/svPaNNyiwdRq6A1VuEfZBTgb4pG2XDkggOtgqYX0
KuzYwtvKvPU/VWJsRYZkEtQ4yCiHUKiKoGz4AiZSHqxLQ4oSAetMx1SUtCTRllb9
bOHaMJkiTh+Iez1t1JRSQtYloW+z2i9w4H/CDwU6YDWOkmvp5URbEtIxUzpAcl3f
E4o9FHcYZKG8KUYobkeSNDD5mo19QDbRUbnLx0TzvtYCbzrg+Ol60yd+8A9lzAz7
6Rz6EePOYXCPjQD3i8OCpbTt1UCGQJB0M6nXr9qNBO5uoBQYMXw=
=uBKg
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: log4j app logging

2018-12-18 Thread Lemke, Michael ST/HZA-ZIC2
Thanks, Ryan, this JULI thing actually is what worries me. I don't care about 
tomcat's logging at the moment. It is my webapp's logging I can't figure out. 
It worked on other containers.

-Original Message-
From: Ryan Palmer
Sent: Tuesday, December 18, 2018 7:49 PM

Michael,

Tomcat uses JULI internally. Have you taken necessary steps to redirect JULI to 
log4j?

Thanks,
Ryan


From: Lemke, Michael ST/HZA-ZIC2 
Sent: Tuesday, December 18, 2018 10:20 AM
To: Tomcat Users List
Subject: RE: log4j app logging

On December 18, 2018 6:59 PM
Ryan Palmer wrote:
>
>The file needs to be named log4j.properties<http://log4j.properties> (or .xml, 
>.json, etc.) and needs to be in the classpath. You ommitted the 'j'.

Thanks for spotting this. Unfortunately, this typo was only in the email:

pc# ls src/main/resources/
com  log4j.properties


So for being in the classpath it is sufficient to have it packaged in the jar, 
isn't it?

Archive:  myapp-1.1.0-SNAPSHOT.jar
 Length   MethodSize  CmprDateTime   CRC-32   Name
  --  ---  -- -   
   0  Stored0   0% 12-18-2018 16:56   META-INF/
  98  Defl:N   91   7% 12-18-2018 16:56 48730e36  META-INF/MANIFEST.MF
   0  Stored0   0% 12-18-2018 16:56   META-INF/maven/
...
   0  Stored0   0% 12-18-2018 16:56   com/
...
1123  Defl:N  451  60% 12-18-2018 16:56 eea5d81a  log4j.properties

It ought to be something simple but before further digging into my setup 
details I want to make sure there isn't something special for tomcat. Something 
in ${catalina.base}/conf or conflicts with tomcat's logging system.


>On Dec 18, 2018, at 9:42 AM, "Lemke, Michael ST/HZA-ZIC2" wrote:
>
>I have an old webapp that uses log4j 1.2 and which I am trying to deploy on 
>tomcat. For the heck of it I can't get tomcat to use the 
>log4.properties<http://log4.properties> file. What am I doing wrong?
>
>tomcat 9.0.6 is installed as a Windows service and does serve my webapp, so 
>the app is working fine. The project is mavenized, I put 
>log4.properties<http://log4.properties> to src/main/resources and it ends up 
>in the jar file of my application. Is there anything special that needs to be 
>done?
>
>
>
>To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>For additional commands, e-mail: users-h...@tomcat.apache.org
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j app logging

2018-12-18 Thread Ryan Palmer
Michael,

Tomcat uses JULI internally. Have you taken necessary steps to redirect JULI to 
log4j?

Thanks,
Ryan


From: Lemke, Michael ST/HZA-ZIC2 
Sent: Tuesday, December 18, 2018 10:20 AM
To: Tomcat Users List
Subject: RE: log4j app logging

On December 18, 2018 6:59 PM
Ryan Palmer wrote:
>
>The file needs to be named log4j.properties<http://log4j.properties> (or .xml, 
>.json, etc.) and needs to be in the classpath. You ommitted the 'j'.

Thanks for spotting this. Unfortunately, this typo was only in the email:

pc# ls src/main/resources/
com  log4j.properties


So for being in the classpath it is sufficient to have it packaged in the jar, 
isn't it?

Archive:  myapp-1.1.0-SNAPSHOT.jar
 Length   MethodSize  CmprDateTime   CRC-32   Name
  --  ---  -- -   
   0  Stored0   0% 12-18-2018 16:56   META-INF/
  98  Defl:N   91   7% 12-18-2018 16:56 48730e36  META-INF/MANIFEST.MF
   0  Stored0   0% 12-18-2018 16:56   META-INF/maven/
...
   0  Stored0   0% 12-18-2018 16:56   com/
...
1123  Defl:N  451  60% 12-18-2018 16:56 eea5d81a  log4j.properties

It ought to be something simple but before further digging into my setup 
details I want to make sure there isn't something special for tomcat. Something 
in ${catalina.base}/conf or conflicts with tomcat's logging system.


>On Dec 18, 2018, at 9:42 AM, "Lemke, Michael ST/HZA-ZIC2" wrote:
>
>I have an old webapp that uses log4j 1.2 and which I am trying to deploy on 
>tomcat. For the heck of it I can't get tomcat to use the 
>log4.properties<http://log4.properties> file. What am I doing wrong?
>
>tomcat 9.0.6 is installed as a Windows service and does serve my webapp, so 
>the app is working fine. The project is mavenized, I put 
>log4.properties<http://log4.properties> to src/main/resources and it ends up 
>in the jar file of my application. Is there anything special that needs to be 
>done?
>
>
>
>To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>For additional commands, e-mail: users-h...@tomcat.apache.org
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: log4j app logging

2018-12-18 Thread Lemke, Michael ST/HZA-ZIC2
On December 18, 2018 6:59 PM
Ryan Palmer wrote:
>
>The file needs to be named log4j.properties (or .xml, 
>.json, etc.) and needs to be in the classpath. You ommitted the 'j'.

Thanks for spotting this. Unfortunately, this typo was only in the email:

pc# ls src/main/resources/
com  log4j.properties


So for being in the classpath it is sufficient to have it packaged in the jar, 
isn't it?

Archive:  myapp-1.1.0-SNAPSHOT.jar
 Length   MethodSize  CmprDateTime   CRC-32   Name
  --  ---  -- -   
   0  Stored0   0% 12-18-2018 16:56   META-INF/
  98  Defl:N   91   7% 12-18-2018 16:56 48730e36  META-INF/MANIFEST.MF
   0  Stored0   0% 12-18-2018 16:56   META-INF/maven/
...
   0  Stored0   0% 12-18-2018 16:56   com/
...
1123  Defl:N  451  60% 12-18-2018 16:56 eea5d81a  log4j.properties

It ought to be something simple but before further digging into my setup 
details I want to make sure there isn't something special for tomcat. Something 
in ${catalina.base}/conf or conflicts with tomcat's logging system.


>On Dec 18, 2018, at 9:42 AM, "Lemke, Michael ST/HZA-ZIC2" wrote:
>
>I have an old webapp that uses log4j 1.2 and which I am trying to deploy on 
>tomcat. For the heck of it I can't get tomcat to use the 
>log4.properties file. What am I doing wrong?
>
>tomcat 9.0.6 is installed as a Windows service and does serve my webapp, so 
>the app is working fine. The project is mavenized, I put 
>log4.properties to src/main/resources and it ends up 
>in the jar file of my application. Is there anything special that needs to be 
>done?
>
>
>
>To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>For additional commands, e-mail: users-h...@tomcat.apache.org
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j app logging

2018-12-18 Thread Ryan Palmer
Michael,

The file needs to be named log4j.properties (or .xml, 
.json, etc.) and needs to be in the classpath. You ommitted the 'j'.

Sent from BlueMail
On Dec 18, 2018, at 9:42 AM, "Lemke, Michael ST/HZA-ZIC2" 
mailto:lemke...@schaeffler.com>> wrote:

I have an old webapp that uses log4j 1.2 and which I am trying to deploy on 
tomcat. For the heck of it I can't get tomcat to use the 
log4.properties file. What am I doing wrong?

tomcat 9.0.6 is installed as a Windows service and does serve my webapp, so the 
app is working fine. The project is mavenized, I put 
log4.properties to src/main/resources and it ends up in 
the jar file of my application. Is there anything special that needs to be done?



To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j: Logging to same file from multiple contexts?

2018-10-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

David,

On 10/8/18 14:27, David Filip wrote:
> Dear Tomcat Users,
> 
> Apologies if this is more of a log4j question, but I thought that
> I'd start here, in case Tomcat has any easy remedies.
> 
> I have a common webapp that I deploy to multiple, different
> contexts.
> 
> In log4j.properties, I have a few different log files defined,
> e.g., for logins:
> 
> log4j.appender.logins=org.apache.log4j.DailyRollingFileAppender 
> log4j.appender.logins.file=${catalina.home}/logs/logins.log 
> log4j.appender.logins.datePattern='.'-MM-dd 
> log4j.appender.logins.append=true 
> log4j.appender.logins.layout=org.apache.log4j.PatternLayout 
> log4j.appender.logins.layout.ConversionPattern=[%d{MM/dd/
> HH:mm:ss}] [%p] [%C{1}]: %m%n
> 
> log4j.logger.com.colornet.CAP.Actions.LoginAction=info, logins 
> log4j.logger.com.colornet.CAP.Util.LoginTokenTag=info, logins
> 
> However, as you may have guessed, if I have the same log4j
> configuration file for each context, the contexts tend to
> over-write each other.
> 
> Is there any way to have the SAME log4j.properties deployed too
> multiple contexts play nicely and not overwrite each other, but
> merely append each other?
> 
> Extra credit question (although sounds even more like a log4j
> question, so apologies): If not, is there any way to define the
> file path, e.g.:
> 
> log4j.appender.logins.file=${catalina.home}/logs/logins.log
> 
> to include the specific context?  I have found a few references on
> the 'Net, e.g., ${contextPath}, ${servletName}, etc., which don't
> seem to work.
> 
> My goal (desire?) is to have the same webapp and configuration and
> web.xml and log4j.properties, etc., deployed to every web context,
> but not have one context overwrite another content's entries.
> 
> Of course, as the Mick once said, "You can't always have what you
> want".
> 
> Please let me know if this is possible.

I'm not sure it's really a great idea to have all these separate
context logging to the same log file(s), but here is a way to do this:

1. Move (*move!*) your log4j.jar file from WEB-INF/lib to Tomcat's
lib/ directory

2. Move (*move!) your log4j.properties file from WEB-INF/classes to
Tomcat's lib/ directory. You may have to wrap it in a JAR file.

This ought to allow log4j to initialize a single time, and each
application will use that singly-initialized log4j instance.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlu+EwQACgkQHPApP6U8
pFjKIA//UL0KHt11kczm28Yv9Ab9WbdHXxnG3dqC25q+HTA1Eq5wu/pTfCGPoa03
R4Sc5r3HpapyeMtZR1XFCPVFPAgbiHQeCD7Bkduw0bCKV8ZOvRJJOgqiXHYiW0cF
RuThsq/txShzRZ1KLqGOuZvfA6MsjIEXdWNdnbSH5g5lDT1mRsabzEpdqbkWXc8W
wru1VWZBNHQwU1k1wZ7ts1jVKZQzJhcO1scs/RWXIHNs8R+dADNsWcsqWzYyeuAm
nWYfhsN03/ilQwBjpAqDBsSnt7a3TvLW4Zh9XrcJylHenOdewj53MdL4AnjS7zUS
+TL3xHB+y8GEIUEsxuuAZy0sKVoPfApEHVovp6cTXzSUi+4fn+gBG2E0zL2o87GD
dfoBsgN3gpMw3oGqB2C67El/ECLIVdo6gU/kw1Pq/asMJPwFMK9OPWk06ScXec7n
ff52KuNt9Oedsm12J7d/GkfMb/8KtvTvzRI30FVf5phCvdkZrOPA0Nsuy40z+jcI
vOwIVcqONUDuG1rkD6Qnm5KwoBDJfkkNTy7BxJS5qtQmCV3dUDm3vvcm5cNzFXlK
b5yvp7UvAPyg13AdjGQd6C0rtG8p+RtTmwJvEZU4bQ16ZYWyQUDhVdLAnvgjb9Iv
jJxF2gAvcLxoqMnEh2AdWCSJjfrQkrZi/4vAYaFYK60EMnElh4w=
=5bwl
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: log4j: Logging to same file from multiple contexts?

2018-10-09 Thread Jäkel , Guido
Dear Dave,

I walk through that years before, too.

Yes - you can't let write different Log4J Appenders to the same file or you get 
this garbage.

Yes - you have property resolving here, but there are no properties you need.


We did a solution using an additional servlet called at application init that 
temporary define a property from the application parameters like virtual host 
and context path, write out the first logging entry to let initialize Log4J 
here, i.e. read the configuration file with the current parameter and finally 
undefine the parameter (for savety). This sequence has to by synchronized by an 
JVM-wide singleton to prevent parallel execution in case you have more than one 
application using this. Write me an email if I should search for the source 
code.


Another solution is to use a SocketAppender and an "central" receiver anywhere 
(running with a standalone JVM)


  <-- 
this name is NOT related to log4j, you may choose any you want.













[...]



  <-- local file logging



The AsyncAppender is chained on top to have a fuse not to block logging (and 
the application) in case of trouble with the receiver.


Greetings

Guido

>-Original Message-
>From: David Filip [mailto:dfi...@colornet.com]
>Sent: Monday, October 08, 2018 8:28 PM
>To: users@tomcat.apache.org
>Subject: log4j: Logging to same file from multiple contexts?
>
>Dear Tomcat Users,
>
>Apologies if this is more of a log4j question, but I thought that I'd start 
>here, in case Tomcat has any easy remedies.
>
>I have a common webapp that I deploy to multiple, different contexts.
>
>In log4j.properties, I have a few different log files defined, e.g., for 
>logins:
>
>log4j.appender.logins=org.apache.log4j.DailyRollingFileAppender
>log4j.appender.logins.file=${catalina.home}/logs/logins.log
>log4j.appender.logins.datePattern='.'-MM-dd
>log4j.appender.logins.append=true
>log4j.appender.logins.layout=org.apache.log4j.PatternLayout
>log4j.appender.logins.layout.ConversionPattern=[%d{MM/dd/ HH:mm:ss}] [%p] 
>[%C{1}]: %m%n
>
>log4j.logger.com.colornet.CAP.Actions.LoginAction=info, logins
>log4j.logger.com.colornet.CAP.Util.LoginTokenTag=info, logins
>
>However, as you may have guessed, if I have the same log4j configuration file 
>for each context, the contexts tend to over-write
>each other.
>
>Is there any way to have the SAME log4j.properties deployed too multiple 
>contexts play nicely and not overwrite each other, but
>merely append each other?
>
>Extra credit question (although sounds even more like a log4j question, so 
>apologies): If not, is there any way to define the
>file path, e.g.:
>
>log4j.appender.logins.file=${catalina.home}/logs/logins.log
>
>to include the specific context?  I have found a few references on the 'Net, 
>e.g., ${contextPath}, ${servletName}, etc., which
>don't seem to work.
>
>My goal (desire?) is to have the same webapp and configuration and web.xml and 
>log4j.properties, etc., deployed to every web
>context, but not have one context overwrite another content's entries.
>
>Of course, as the Mick once said, "You can't always have what you want".
>
>Please let me know if this is possible.
>
>Thanks,
>
>Dave.
>
>
>


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j

2018-05-22 Thread Luis Rodríguez Fernández
Hello Chris,

You can have a look here:
https://logging.apache.org/log4j/2.x/log4j-appserver/index.html

Hope it helps,

Luis

2018-05-18 19:55 GMT+02:00 George Stanchev :

> Depends on what you're asking. If you're asking to use log4j to capture
> Tomcat logging, then the answer is - you can't but you can use Log4j2 or
> JULI. If the question is how to use log4j for your apps deployed under
> Tomcat, then answer can be found easily...
>
> From: Cheltenham, Chris 
> Sent: Friday, May 18, 2018 7:50 AM
> To: 'Tomcat Users List' 
> Subject: log4j
>
> Hello,
>
> How do I configure Tomcat 8.5.x to use log4j?
>
> Is there a good document to follow?
>
> I am not very familiar with java but it looks like you configure to logs
> to accept java logging for Tomcat.
>
>
> ===
>
> Thank You;
>
> Chris Cheltenham
> Technology Services
> The School District of Philadelphia
>
> Work # 215-400-5025
> Cell # 215-301-6571
>



-- 

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett


RE: log4j

2018-05-18 Thread George Stanchev
Depends on what you're asking. If you're asking to use log4j to capture Tomcat 
logging, then the answer is - you can't but you can use Log4j2 or JULI. If the 
question is how to use log4j for your apps deployed under Tomcat, then answer 
can be found easily...

From: Cheltenham, Chris 
Sent: Friday, May 18, 2018 7:50 AM
To: 'Tomcat Users List' 
Subject: log4j

Hello,

How do I configure Tomcat 8.5.x to use log4j?

Is there a good document to follow?

I am not very familiar with java but it looks like you configure to logs to 
accept java logging for Tomcat.


===

Thank You;

Chris Cheltenham
Technology Services
The School District of Philadelphia

Work # 215-400-5025
Cell # 215-301-6571


Re: log4j

2018-05-18 Thread José Cornado
Also, it may make more sense to code log4j into your app. If you change
servers the logging goes with it.

Best,

J

On Fri, May 18, 2018 at 8:06 AM M. Manna  wrote:

> Hi Chris,
>
> How r u planning to use Log4j (or log4j2, which solves a lot of performance
> issues for 1.2.x)?
>
> Are you bridging with SLF4J or or using directly?
>
> All log4j configuration are automatically discovered and configured
> provided that you have set up your appplication log4j properties file
> correctly.
>
> Tomcat doesn't do anything specific to log4j-related setup. There is a
> logging properties file in /conf/ which are for JULI logging, as a bare
> minimum OOB setup for catalina.
>
> If you can perhaps clarify your use case, others can advise better.
>
> regards,
>
> On 18 May 2018 at 14:49, Cheltenham, Chris 
> wrote:
>
> > Hello,
> >
> >
> >
> > How do I configure Tomcat 8.5.x to use log4j?
> >
> >
> >
> > Is there a good document to follow?
> >
> >
> >
> > I am not very familiar with java but it looks like you configure to logs
> > to accept java logging for Tomcat.
> >
> >
> >
> >
> >
> > ===
> >
> > Thank You;
> >
> > Chris Cheltenham
> > Technology Services
> > The School District of Philadelphia
> >
> > Work # 215-400-5025
> > Cell # 215-301-6571
> >
>


Re: log4j

2018-05-18 Thread M. Manna
Hi Chris,

How r u planning to use Log4j (or log4j2, which solves a lot of performance
issues for 1.2.x)?

Are you bridging with SLF4J or or using directly?

All log4j configuration are automatically discovered and configured
provided that you have set up your appplication log4j properties file
correctly.

Tomcat doesn't do anything specific to log4j-related setup. There is a
logging properties file in /conf/ which are for JULI logging, as a bare
minimum OOB setup for catalina.

If you can perhaps clarify your use case, others can advise better.

regards,

On 18 May 2018 at 14:49, Cheltenham, Chris 
wrote:

> Hello,
>
>
>
> How do I configure Tomcat 8.5.x to use log4j?
>
>
>
> Is there a good document to follow?
>
>
>
> I am not very familiar with java but it looks like you configure to logs
> to accept java logging for Tomcat.
>
>
>
>
>
> ===
>
> Thank You;
>
> Chris Cheltenham
> Technology Services
> The School District of Philadelphia
>
> Work # 215-400-5025
> Cell # 215-301-6571
>


Re: log4j in Tomcat 8.5

2017-02-02 Thread Mark Thomas

On 02/02/17 21:53, George Stanchev wrote:

Hi,

I am transitioning from Tomcat 7.0 to Tomcat 8.5 and I was wondering what do I 
need to do to use log4j in 8.5. Reading this bug [1], it states that the 
support for the for log4j has been dropped since it is EOLed. Now, there is a 
comment on this issue from Mark that says that it is applied against version 9, 
but this bug was referenced from the changelog for 8.5 [2] that states:


Correct a regression in the fix for 58588 that removed the entire 
org.apache.juli package from the embedded JARs rendering them unusable. (markt)


which implies it has been applied to 8.5. So my question is, can I make Tomcat 
8.5 use log4j?


log4j - no

log4j2 - yes

You'll need to use the standard log4j2 mechanism to capture 
java.util.logging output and redirect it.


Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j Issue

2016-08-10 Thread Mark Eggers
Syed,

Please do not top post. See:

http://tomcat.apache.org/lists.html#tomcat-users

item 6.


My responses are inline.

On 8/10/2016 1:43 AM, Syed Mudassir Ahmed wrote:
> Mark,
>   Thanks for the response.
>   Indeed I am using Log4j-2.  Below is my xml file:
> 
> 
> 
>   
>  
>  filePattern="/home/syed/logs/ssp-log-%d{MM-dd-}-%i.txt">
>   
> date:%d, millisecs:%r, level:%p, logger:%c, thread:[%t],
> file:%F, method:%M, line:%L, message:%m%n%n
>   
>   
> 
>   
>   
> 
>   
>   
> 
>
> 
> 
>   
> 
>   
> 

You really need to read the log4j2 documentation. In particular, pay
attention to the logger documentation.

> 
> And in my web app, I have the following statement that will set the system
> property to where the above file is located at:
> 
> System.setProperty("log4j.configurationFile", "file://" + rootPath +
> "/log4j-2.xml");

You really need to read the link I gave you on how log4j2 is configured
with web applications.

Again, the link is:

https://logging.apache.org/log4j/2.x/manual/webapp.html

Follow it slavishly until you get things working.

You really need to follow the documentation on where to place log4j2.xml
and how that file is found.

http://logging.apache.org/log4j/2.x/manual/configuration.html

In particular, pay attention to Automatic Configuration, item 9. I
recommend this until you do a little more reading / research, and
understand how things work.

That's why I recommended to place log4j2.xml in WEB-INF/classes or in a
JAR file in WEB-INF/lib. It's then on the web application classpath. No
other configuration is necessary.

In particular, pay attention to what happens when you do not configure
log4j2 correctly, notably Automatic Configuration, item 10.

10. If no configuration file could be located the DefaultConfiguration
will be used. This will cause logging output to go to the console.

This will dump your log output to the console, which ends up in
catalina.out when running in Tomcat.

> 
> 
> Thanks,
> 
> 
> On Wed, Aug 10, 2016 at 11:59 AM, Mark Eggers > wrote:
> 
>> Syed,
>>
>> On 8/9/2016 10:08 PM, Syed Mudassir Ahmed wrote:
>>> I am using Log4j in my web app to write the logs to a separate file.
>>> Surprisingly, that log file is not at all getting created.  I run
>>> the logger logic as a standalone application and the log file indeed
>>> gets created.  I am assuming tomcat is not allowing me to write my
>>> logs to a file.  It is simply redirecting all the log messages to
>>> catalina.out.  Any suggestions on how to direct my logs to a separate
>>> file and not to catalina.out.
>>>
>>> Thanks,
>>>
>>
>> Hmm,
>>
>> Works for me . . .
>>
>> 
>> >   'PUBLIC:-//log4j/log4j Configuration//EN'
>>   'http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-
>>   files/log4j.dtd'>
>> 
>>   
>> 
>> 
>>   
>> 
>>   
>>   
>> 
>> 
>>   
>> 
>>
>> (sorry for the word wrap for the !DOCTYPE line).
>>
>> Since log4j 1.x was retired in April of 2015, maybe you should move to
>> log4j2.
>>
>> Read the following:
>>
>> https://logging.apache.org/log4j/2.x/manual/webapp.html
>>
>> A (more or less) corresponding log4j2.xml file (different app):
>>
>> 
>> 
>> 
>> > immediateFlush="true"
>> fileName="${sys:catalina.base}/logs/logstwo.log"
>> filePattern=
>>  "${sys:catalina.base}/logs/logstwo-%d{-MM-dd}.log.gz">
>> 
>> %d %-5p %c.%M:%L - %m%n
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>
>> Note, the log4j2.xml does log rotation, as well as compression of the
>> rotated log files. It also logs at a package level one higher than the
>> log4j.xml configuration.
>>
>> The XML file (log4j.xml or log4j2.xml) goes into WEB-INF/classes, or in
>> a JAR file in WEB-INF/lib.
>>
>> The appropriate log4j jar files (different between log4j and log4j2) go
>> in WEB-INF/lib.
>>
>> Quite frankly, your question is very broad and without writing a
>> tutorial it's difficult to answer.
>>
>> I suggest reading the following as well:
>>
>> http://www.catb.org/~esr/faqs/smart-questions.html
>>

. . . just my two cents
/mde/






signature.asc
Description: OpenPGP digital signature


Re: Log4j Issue

2016-08-10 Thread Syed Mudassir Ahmed
Mark,
  Thanks for the response.
  Indeed I am using Log4j-2.  Below is my xml file:



  

  
date:%d, millisecs:%r, level:%p, logger:%c, thread:[%t],
file:%F, method:%M, line:%L, message:%m%n%n
  
  

  
  

  
  

   


  

  


And in my web app, I have the following statement that will set the system
property to where the above file is located at:

System.setProperty("log4j.configurationFile", "file://" + rootPath +
"/log4j-2.xml");


Thanks,


On Wed, Aug 10, 2016 at 11:59 AM, Mark Eggers  wrote:

> Syed,
>
> On 8/9/2016 10:08 PM, Syed Mudassir Ahmed wrote:
> > I am using Log4j in my web app to write the logs to a separate file.
> > Surprisingly, that log file is not at all getting created.  I run
> > the logger logic as a standalone application and the log file indeed
> > gets created.  I am assuming tomcat is not allowing me to write my
> > logs to a file.  It is simply redirecting all the log messages to
> > catalina.out.  Any suggestions on how to direct my logs to a separate
> > file and not to catalina.out.
> >
> > Thanks,
> >
>
> Hmm,
>
> Works for me . . .
>
> 
>'PUBLIC:-//log4j/log4j Configuration//EN'
>   'http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-
>   files/log4j.dtd'>
> 
>   
> 
> 
>   
> 
>   
>   
> 
> 
>   
> 
>
> (sorry for the word wrap for the !DOCTYPE line).
>
> Since log4j 1.x was retired in April of 2015, maybe you should move to
> log4j2.
>
> Read the following:
>
> https://logging.apache.org/log4j/2.x/manual/webapp.html
>
> A (more or less) corresponding log4j2.xml file (different app):
>
> 
> 
> 
>  immediateFlush="true"
> fileName="${sys:catalina.base}/logs/logstwo.log"
> filePattern=
>  "${sys:catalina.base}/logs/logstwo-%d{-MM-dd}.log.gz">
> 
> %d %-5p %c.%M:%L - %m%n
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> Note, the log4j2.xml does log rotation, as well as compression of the
> rotated log files. It also logs at a package level one higher than the
> log4j.xml configuration.
>
> The XML file (log4j.xml or log4j2.xml) goes into WEB-INF/classes, or in
> a JAR file in WEB-INF/lib.
>
> The appropriate log4j jar files (different between log4j and log4j2) go
> in WEB-INF/lib.
>
> Quite frankly, your question is very broad and without writing a
> tutorial it's difficult to answer.
>
> I suggest reading the following as well:
>
> http://www.catb.org/~esr/faqs/smart-questions.html
>
> . . . just my two cents
> /mde/
>
>


Re: Log4j Issue

2016-08-10 Thread Mark Eggers
Syed,

On 8/9/2016 10:08 PM, Syed Mudassir Ahmed wrote:
> I am using Log4j in my web app to write the logs to a separate file. 
> Surprisingly, that log file is not at all getting created.  I run
> the logger logic as a standalone application and the log file indeed
> gets created.  I am assuming tomcat is not allowing me to write my
> logs to a file.  It is simply redirecting all the log messages to
> catalina.out.  Any suggestions on how to direct my logs to a separate
> file and not to catalina.out.
> 
> Thanks,
> 

Hmm,

Works for me . . .


http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-
  files/log4j.dtd'>

  


  

  
  


  


(sorry for the word wrap for the !DOCTYPE line).

Since log4j 1.x was retired in April of 2015, maybe you should move to
log4j2.

Read the following:

https://logging.apache.org/log4j/2.x/manual/webapp.html

A (more or less) corresponding log4j2.xml file (different app):






%d %-5p %c.%M:%L - %m%n
















Note, the log4j2.xml does log rotation, as well as compression of the
rotated log files. It also logs at a package level one higher than the
log4j.xml configuration.

The XML file (log4j.xml or log4j2.xml) goes into WEB-INF/classes, or in
a JAR file in WEB-INF/lib.

The appropriate log4j jar files (different between log4j and log4j2) go
in WEB-INF/lib.

Quite frankly, your question is very broad and without writing a
tutorial it's difficult to answer.

I suggest reading the following as well:

http://www.catb.org/~esr/faqs/smart-questions.html

. . . just my two cents
/mde/



signature.asc
Description: OpenPGP digital signature


Re: Log4j problems after replacing tomcat7 to tomcat8

2015-10-25 Thread Konstantin Kolinko
2015-10-25 16:59 GMT+03:00 Hani Nabwani :
> Tomcat version 8.0.28.
> Os: linux.3.14.44-32.39.
>
> I am running tomcat8, before that i ran tomcat7 with no problems.
> After new tomcat8 release i uninstalled tomcat7 and installed tomcat8.
> Then the log file of my app is never created, i tried to search (find
> command) i get nothing, also i tried to find log4j.properties  file,
> also i cant find it.
> Where tomcat8 save the log file?
> Where tomcat8 save the log4j.properties file.
>
> My log4j. properties file is:
> log4j.rootLogger=ERROR, CA, FA
> log4j.appender.CA=org.apache.log4j.ConsoleAppender
> log4j.appender.CA.Target=System.out
> log4j.appender.CA.layout=org.apache.log4j.PatternLayout
> log4j.appender.CA.layout.ConversionPattern=%d{-MM-dd HH:mm:ss}
> %-5p %c:%L - %m%n
> log4j.appender.FA=org.apache.log4j.RollingFileAppender
> log4j.appender.FA.File=${catalina.base}/logs/D12.log
> log4j.appender.FA.MaxFileSize=5MB
> log4j.appender.FA.MaxBackupIndex=10
> log4j.appender.FA.layout=org.apache.log4j.PatternLayout
> log4j.appender.FA.layout.ConversionPattern=[%d{-MM-dd HH:mm:ss}]
> [%-5p] [%c:%L]: %m%n
> log4j.logger.com.datastax.driver.core=ERROR


There is no such file in default Tomcat configuration (as distributed
by tomcat.apache.org).

Tomcat by default uses java.util.logging.   It is possible to
reconfigure it to use Log4J 1.x  (and some 3-rd party distributions
provided such configuration), but that is not the default
configuration.

https://wiki.apache.org/tomcat/FAQ/Linux_Unix#Q5
http://tomcat.apache.org/tomcat-8.0-doc/logging.html

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j with Apache Tomcat 8.0.17

2015-01-21 Thread George Sexton

Thank you. That worked. Should i open a ticket in bugzilla to fix the doc?


On 1/21/2015 1:43 PM, Mark Thomas wrote:

On 21/01/2015 20:27, George Sexton wrote:

I'm having a problem configuring log4j with Apache Tomcat 8.0.17. I'm
using OpenSUSE 13.2 with OpenJDK 8.0:

linux:java -version
openjdk version 1.8.0_40
OpenJDK Runtime Environment (build 1.8.0_40-b10)
OpenJDK 64-Bit Server VM (build 25.40-b14, mixed mode)

I'm following the instructions in the log4j section of the Logging in
Tomcat section of the Tomcat documentation. The steps do not appear to
work, and there is no information in the log file that I can see that
would assist me in troubleshooting this.

Referencing the steps:

1) I have created log4j.properties in $CATALINA_BASE/lib. The file is
readable by the tomcat user.

linux:/srv/tomcat/lib # ls -al log4j.properties
-rw-r--r-- 1 root root 2343 Jan 21 12:57 log4j.properties

2) I have downloaded log4j 1.2 or later (version 2.1)

Try with the latest 1.x release. I'm fairly sure the API changes between
1.x and 2.x mean code changes are required on Tomcat's side to support 2.x.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



--
George Sexton
*MH Software, Inc.*
Voice: 303 438 9585
http://www.mhsoftware.com


Re: Log4j with Apache Tomcat 8.0.17

2015-01-21 Thread Mark Thomas
On 21/01/2015 21:04, George Sexton wrote:
 Thank you. That worked. Should i open a ticket in bugzilla to fix the doc?

Please.

Mark


 
 
 On 1/21/2015 1:43 PM, Mark Thomas wrote:
 On 21/01/2015 20:27, George Sexton wrote:
 I'm having a problem configuring log4j with Apache Tomcat 8.0.17. I'm
 using OpenSUSE 13.2 with OpenJDK 8.0:

 linux:java -version
 openjdk version 1.8.0_40
 OpenJDK Runtime Environment (build 1.8.0_40-b10)
 OpenJDK 64-Bit Server VM (build 25.40-b14, mixed mode)

 I'm following the instructions in the log4j section of the Logging in
 Tomcat section of the Tomcat documentation. The steps do not appear to
 work, and there is no information in the log file that I can see that
 would assist me in troubleshooting this.

 Referencing the steps:

 1) I have created log4j.properties in $CATALINA_BASE/lib. The file is
 readable by the tomcat user.

 linux:/srv/tomcat/lib # ls -al log4j.properties
 -rw-r--r-- 1 root root 2343 Jan 21 12:57 log4j.properties

 2) I have downloaded log4j 1.2 or later (version 2.1)
 Try with the latest 1.x release. I'm fairly sure the API changes between
 1.x and 2.x mean code changes are required on Tomcat's side to support
 2.x.

 Mark


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j with Apache Tomcat 8.0.17

2015-01-21 Thread Mark Thomas
On 21/01/2015 20:27, George Sexton wrote:
 I'm having a problem configuring log4j with Apache Tomcat 8.0.17. I'm
 using OpenSUSE 13.2 with OpenJDK 8.0:
 
 linux:java -version
 openjdk version 1.8.0_40
 OpenJDK Runtime Environment (build 1.8.0_40-b10)
 OpenJDK 64-Bit Server VM (build 25.40-b14, mixed mode)
 
 I'm following the instructions in the log4j section of the Logging in
 Tomcat section of the Tomcat documentation. The steps do not appear to
 work, and there is no information in the log file that I can see that
 would assist me in troubleshooting this.
 
 Referencing the steps:
 
 1) I have created log4j.properties in $CATALINA_BASE/lib. The file is
 readable by the tomcat user.
 
 linux:/srv/tomcat/lib # ls -al log4j.properties
 -rw-r--r-- 1 root root 2343 Jan 21 12:57 log4j.properties
 
 2) I have downloaded log4j 1.2 or later (version 2.1)

Try with the latest 1.x release. I'm fairly sure the API changes between
1.x and 2.x mean code changes are required on Tomcat's side to support 2.x.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j to write Tomcat logs to Windows Event Log

2012-07-24 Thread sandy
Hello, 

Did you install Tomcat as a Windows service using the installer for windows?
If that's the case, review your configuration. The same occurred to me and I
solved it by configuring the service. Right-click on tomcat icon at the
systray and then click on Configure In the Java tab, in the field
Java Options, I have the following properties defined:

...
-Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat
7.0\endorsed
...
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Program Files\Apache Software
Foundation\Tomcat 7.0\lib\log4j.properties
...

Finally, I created the C:\Program Files\Apache Software Foundation\Tomcat
7.0\endorsed because I didn't exist and then I copied log4j.jar inside it.
By doing this, the warning message disappeared, at least that was my case.

I hope my solution works for you as well. Good luck. 
  Sandy




--
View this message in context: 
http://tomcat.10.n6.nabble.com/log4j-to-write-Tomcat-logs-to-Windows-Event-Log-tp4983672p4984394.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j to write Tomcat logs to Windows Event Log

2012-07-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kevin,

On 7/9/12 11:52 AM, Dunbar, Kevin D CIV SPAWARSYSCEN-PACIFIC, 56250 wrote:
 Thank you Chris and Konstantin for replying to my message. Here is
  the contents of the log4j.properties file... (This was taken from
 the instructions on the Tomcat website for logging with log4j).
 Thank you again for any help you can provide.
 
 log4j.rootLogger=INFO, CATALINA # Define all the appenders 
 log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender 
 log4j.appender.CATALINA.File=${catalina.base}/logs/catalina. 
 log4j.appender.CATALINA.Append=true 
 log4j.appender.CATALINA.Encoding=UTF-8

That looks okay to me, except that I didn't realize that
$CATALINA_BASE/lib would load JAR files contained in it as well as raw
resources, but you are following the documentation faithfully.

Try setting the -Dlog4j.debug system property (no specific value is
necessary) and log4j should spew a lot of stuff to stdout that you can
see when it is performing its configuration -- you'll be able to see
when it first initializes and what happens at that time.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/8WHAACgkQ9CaO5/Lv0PCUdgCgqLRF2DZ5DLZQSZQTx8OIm4ve
+2kAnRMAv7w7iUHHIcT5JDdh2Y0BA1tb
=0B8R
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: log4j to write Tomcat logs to Windows Event Log

2012-07-09 Thread Dunbar, Kevin D CIV SPAWARSYSCEN-PACIFIC, 56250
Thank you Chris and Konstantin for replying to my message.  Here is the 
contents of the log4j.properties file...
(This was taken from the instructions on the Tomcat website for logging with 
log4j).  Thank you again for any help you can provide.
 
 
 
log4j.rootLogger=INFO, CATALINA
# Define all the appenders
log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CATALINA.File=${catalina.base}/logs/catalina.
log4j.appender.CATALINA.Append=true
log4j.appender.CATALINA.Encoding=UTF-8
# Roll-over the log once per day
log4j.appender.CATALINA.DatePattern='.'-MM-dd'.log'
log4j.appender.CATALINA.layout = org.apache.log4j.PatternLayout
log4j.appender.CATALINA.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
log4j.appender.LOCALHOST=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LOCALHOST.File=${catalina.base}/logs/localhost.
log4j.appender.LOCALHOST.Append=true
log4j.appender.LOCALHOST.Encoding=UTF-8
log4j.appender.LOCALHOST.DatePattern='.'-MM-dd'.log'
log4j.appender.LOCALHOST.layout = org.apache.log4j.PatternLayout
log4j.appender.LOCALHOST.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
log4j.appender.MANAGER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.MANAGER.File=${catalina.base}/logs/manager.
log4j.appender.MANAGER.Append=true
log4j.appender.MANAGER.Encoding=UTF-8
log4j.appender.MANAGER.DatePattern='.'-MM-dd'.log'
log4j.appender.MANAGER.layout = org.apache.log4j.PatternLayout
log4j.appender.MANAGER.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
log4j.appender.HOST-MANAGER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.HOST-MANAGER.File=${catalina.base}/logs/host-manager.
log4j.appender.HOST-MANAGER.Append=true
log4j.appender.HOST-MANAGER.Encoding=UTF-8
log4j.appender.HOST-MANAGER.DatePattern='.'-MM-dd'.log'
log4j.appender.HOST-MANAGER.layout = org.apache.log4j.PatternLayout
log4j.appender.HOST-MANAGER.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Encoding=UTF-8
log4j.appender.CONSOLE.layout = org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
# Configure which loggers log to which appenders
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO,
 LOCALHOST
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]=\
  INFO, MANAGER
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]=\
  INFO, HOST-MANAGER

 
 
 
Kevin Dunbar
Code 56250
SPAWAR Systems Center Pacific
(619) 553-0777
kevin.dun...@navy.mil



From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Sun 7/8/2012 9:33 AM
To: Tomcat Users List
Subject: Re: log4j to write Tomcat logs to Windows Event Log



-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Konstantin,

On 7/8/12 5:40 AM, Konstantin Kolinko wrote:
 Your log4j.properties is wrong?

+1

Kevin, can you post your log4j.properties file?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org http://gpgtools.org/ 
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/5tm4ACgkQ9CaO5/Lv0PBt8gCfaGjSj3MVwx6u8JtTu6AEUP3F
/6cAoJD3RAl01y6N2PxS8X/9FeZ1/Ax8
=+OEK
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j to write Tomcat logs to Windows Event Log

2012-07-08 Thread Konstantin Kolinko
2012/7/7 Dunbar, Kevin D CIV SPAWARSYSCEN-PACIFIC, 56250
kevin.dun...@navy.mil:
 Hi,

 I am trying to use log4j.jar to do the logging in Tomcat 7.0.27 (on Windows 
 XP) instead of java.util.logging so that I can append the logs to be output 
 to the Windows Event Log.

 I followed the instructions to configure Tomcat to use log4j rather than 
 java.util.logging for all Tomcat's internal logging.  
 (http://tomcat.apache.org/tomcat-7.0-doc/logging.html)

 I created a log4j.properties file and put it in $CATALINA_BASE/lib
 I put log4j-1.2.15.jar that I downloaded into $CATALINA_HOME/lib
 I put tomcat-juli-adapters.jar that I downloaded into $CATALINA_HOME/lib
 I replaced tomcat-juli.jar from $CATALINA_HOME with the tomcat-juli.jar that 
 I downloaded from Tomcat extras

 It seems that after I replaced the tomcat-juli.jar, I would get the following 
 error in tomcat7-stderr.log

 2012-07-06 14:03:56 Commons Daemon procrun stderr initialized
 log4j:WARN No appenders could be found for logger 
 (org.apache.catalina.startup.Catalina).
 log4j:WARN Please initialize the log4j system properly.

Your log4j.properties is wrong?
It looks like it does not specify where the messages from
org.apache.catalina.startup.Catalina log category should be written.

 I also deleted the logging.properties from $CATALINA_BASE/conf

One should not delete the file itself, but only its contents, leaving
an empty file.

 Can anyone please tell me why this warning is occurring when I replace 
 tomcat-juli.jar?  Any help is greatly appreciated.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j to write Tomcat logs to Windows Event Log

2012-07-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Konstantin,

On 7/8/12 5:40 AM, Konstantin Kolinko wrote:
 Your log4j.properties is wrong?

+1

Kevin, can you post your log4j.properties file?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/5tm4ACgkQ9CaO5/Lv0PBt8gCfaGjSj3MVwx6u8JtTu6AEUP3F
/6cAoJD3RAl01y6N2PxS8X/9FeZ1/Ax8
=+OEK
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j per context admin managable configs?

2011-10-06 Thread Rainer Jung
On 07.10.2011 03:12, Ilya Kazakevich wrote:
 Hello,
 
 My app uses log4j. I have several apps running in my tomcat 6 in different
 contexts. I want to log them to different files but filenames (as well as
 levels and even appenders) should be configurable by admin.
 
 Something like this:
 
 ./config/ENGINE_NAME/HOST_NAME/ContextName/log4j.properties
 
 I can't put log4j directly in tomcat so all apps would use one config (and
 it is not what I want).
 I can't put a copy to the each .war file too because admin would not be able
 to reconfigure them.
 
 Does there is a nice solution (with out of custom code)?

You can use the VirtualWebappLoader, at least if Log4J in your webapps
is configured as usual using the class loader search. If it is
configured programmatically, then there is little you can do.

The VirtualWebappLoader allows to extend the search path for the class
loader of a web application by external directories and jars. So you can
e.g. add ${catalina.base}/ENGINE_NAME/HOST_NAME/CONTEXT_NAME/ the the
path for the context named CONTEXT_NAME.

The VirtualWebappLoader exists since quite some time in TC 6, but only
in TC 7 it gained non-experimental status. Nevertheless it does work in
TC 6 too. The configuration is done in a Loader element nested in the
Context element in the context deployment descriptor (aka context.xml or
myapp.xml).

For TC 6 the docs are somewhat hidden:

http://tomcat.apache.org/tomcat-6.0-doc/api/index.html

for TC 7 it is a first class citizen documented at

http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html#VirtualWebappLoader_Implementation

Important note: old versions of the VirtualWebappLoader appended the
additional search path components, so anything found inside the webapp
won. Of course here you want to overwrite something in the war, so you
want the path components to get prepended. The attribute
searchVirtualFirst=true configures that. This is only available in TC
6.0.33 (and TC 7 since 7.0.0).

Example:

?xml version=1.0 encoding=UTF-8?
Context
Loader className=org.apache.catalina.loader.VirtualWebappLoader
searchVirtualFirst=true
virtualClasspath=${catalina.base}/conf/myapp/
/Context

There is also another option: if you only want to make the path to the
log files configurable and you can agree on a solution with the webapp
developers, you can convince them to use a system property for the log
path, that you can set during TC startup. Since system properties are
global, you would need a different system property for each webapp if
you want to configure different directories.

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j logging works for webapps but not for server,

2011-06-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

To whom it may concern,

On 6/23/2011 5:44 PM, jjgtx wrote:
 Followed the
 instructions at http://tomcat.apache.org/tomcat-6.0-doc/logging.html
 replacing the tomcat-juli.jar file in $CATALINA_HOME/bin with the one from
 extras and placing the log4j.jar and tomcat-juli-adapters.jar in the lib
 directory. Running with log4j debug I can see the categories registered.

Where did you put your log4j.properties file and what does it contain?
Can you just post the whole thing?

Also what exact version of TC 6.0 are you using? It probably doesn't
matter but it doesn't hurt to know.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4En8sACgkQ9CaO5/Lv0PDkCgCeLvl177BjdNZzldBWGrOvH/TT
DS8AnAuxWSWKKs5E9+AL0UmS1Q6qSGnD
=aFg+
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j logging works for webapps but not for server,

2011-06-24 Thread jjgtx





Where did you put your log4j.properties file and what does it contain?
Can you just post the whole thing?
/qoute
$CATALINA_HOME/lib

I hate to post the whole thing, its a bit long would it be better to send
it?

One thing I was curious about is that should be the value of the
$LOGGING_CONFIG property. I used the path to the log4j file. 


Christopher Schultz-2 wrote:
 
 Also what exact version of TC 6.0 are you using? It probably doesn't
 matter but it doesn't hurt to know.
 /qoute
 Server version: Apache Tomcat/6.0.18
 Server built:   Jul 22 2008 02:00:36
 Server number:  6.0.18.0
 OS Name:Linux
 OS Version: 2.6.18-164.11.1.el5PAE
 Architecture:   i386
 JVM Version:1.6.0_18-b07
 JVM Vendor: Sun Microsystems Inc.
  
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAk4En8sACgkQ9CaO5/Lv0PDkCgCeLvl177BjdNZzldBWGrOvH/TT
 DS8AnAuxWSWKKs5E9+AL0UmS1Q6qSGnD
 =aFg+
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/log4j-logging-works-for-webapps-but-not-for-server%2C-tp31915060p31921142.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j logging works for webapps but not for server,

2011-06-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

To whom it may concern,

On 6/24/2011 12:18 PM, jjgtx wrote:
 Christopher Schultz-2 wrote:
 Where did you put your log4j.properties file and what does it contain?
 Can you just post the whole thing?

 [I put log4j.properties in] $CATALINA_HOME/lib
 
 I hate to post the whole thing, its a bit long would it be better to send
 it?

I was mainly concerned with what you appender configuration looked like,
in case you misconfigured something there and therefore were getting no
logs due to that.

Is your configuration file similar to that described in
http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_Log4j?

Given the output on startup:

 log4j: Handling log4j.additivity.org.apache.catalina=[null]
 log4j: Parsing for [org] with value=[WARN].
 log4j: Level token is [WARN].

I suspect that log4j is actually being loaded and configured, though :)

 One thing I was curious about is that should be the value of the
 $LOGGING_CONFIG property. I used the path to the log4j file. 

I don't believe you need to set LOGGING_CONFIG to anything: I believe
LOGGING_CONFIG is only used for the JULI configuration (which is
mutually exclusive to using log4j).

Try significantly simplifying your environment and configuration:

0. Shut-down Tomcat and delete all files from logs/
1. Don't deploy any webapps... just work with Tomcat itself for now
2. Remove all appenders except for a single FileAppender,
   point that to a writable file, set the log level to INFO
3. Make sure you have:

   log4j.rootCategory=INFO,[appendername]

Start up Tomcat and see if you get anything in your log file. There
should be a few INFO messages in there.

If that doesn't work, please post your whole (simplified as described
above) log file and a complete dump of:

1. logs/catalina.out
2. logs/*   (any other files that are created on startup,
   even if they are empty)

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4Ewr0ACgkQ9CaO5/Lv0PC22gCfekanthUWmdkA6SLKeGbRjVgh
SgwAnA89L6+n2KbTnn8iUIg46Ywwpg9Z
=Pn/U
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j config

2011-05-16 Thread Konstantin Kolinko
2011/5/17 Bruce Pease bpe...@wth.com:
 I have an issue with log4j 1.2.16 where the max file size on the rolling file
 appender is not working (also not on 1.2.15)  However, when I go back to my
 previous log4j version (1.2.9), the file backups do work.  Was there a config
 change, or is this a known issue?  My config is below:

Ask this on their (log4j) mailing list. Other documentation should be
there as well.

http://logging.apache.org/log4j/1.2/index.html
http://logging.apache.org/mail-lists.html

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j

2010-07-08 Thread Pid
This would be a question for the log4j list, no?


p

On 8 Jul 2010, at 11:25, Kaushal Shriyan kaushalshri...@gmail.com wrote:

 Hi,
 
 Is there a way to run log4j appender at a specified time?
 
 log4j.rootLogger=INFO, R
 log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.R.File=${catalina.home}/logs/catalina.out
 log4j.appender.R.DatePattern='.'-MM-dd
 log4j.appender.R.layout=org.apache.log4j.PatternLayout
 
 I have put the log4j.properties under /opt/tomcat0/common/classes
 
 Please suggest.
 
 Thanks and Regards
 
 Kaushal
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-06 Thread Mark H. Wood
On Wed, May 05, 2010 at 08:31:33AM -0500, Caldarale, Charles R wrote:
 As always, don't put Context elements in server.xml.  The above got you 
 double deployment of the foo webapp, once as foo, once as the default.
 
 Why do people invite problems when it's so easy to do things properly?

Maybe because the documentation doesn't say it's improper; it says you
can do this.  Your advice in this matter makes good sense when you
explain it, but nobody sees it until he runs into a problem and brings
it here.  I think a documentation update from you would be widely
appreciated, and save you loads of time in the long run.

-- 
Mark H. Wood, Lead System Programmer   mw...@iupui.edu
Balance your desire for bells and whistles with the reality that only a 
little more than 2 percent of world population has broadband.
-- Ledford and Tyler, _Google Analytics 2.0_


pgpRwq5u3Yj8X.pgp
Description: PGP signature


RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-06 Thread Caldarale, Charles R
 From: Mark H. Wood [mailto:mw...@iupui.edu]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 Maybe because the documentation doesn't say it's improper;

The current documentation for Context states (in bold):

For Tomcat 6, unlike Tomcat 4.x, it is NOT recommended to place Context 
elements directly in the server.xml file.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-05 Thread Pid
On 05/05/2010 02:24, Caldarale, Charles R wrote:
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 Scenario 1:
 log4j.jar is in Tomcat/lib directory
 log4j.jar is NOT in WEB-INF/lib directories
 
 Have you added *anything* else to Tomcat's lib directory?
 
 Scenario 3:
 log4j.jar is in Tomcat/lib directory
 log4j.jar is in WEB-INF/lib directories
 
 You must never have the same classes located in more than one spot in a given 
 branch of the classloader tree, so the above is not a valid configuration.

@joe
Have you cleared out the tomcat/work directory?


p

  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
 MATERIAL and is thus for use only by the intended recipient. If you received 
 this in error, please contact the sender and delete the e-mail and its 
 attachments from all computers.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-05 Thread Mark Eggers
.

/mde/

--- On Tue, 5/4/10, Joe Hansen joe.hansen...@gmail.com wrote:

 From: Joe Hansen joe.hansen...@gmail.com
 Subject: Re: Log4j logging doesn't work when a web application is moved  
 outside Tomcat/webapps directory
 To: Tomcat Users List users@tomcat.apache.org
 Date: Tuesday, May 4, 2010, 4:55 PM
 This thread has grown too long. For
 anyone following this thread,
 here's the summary:
 
 Two web applications, each with a Virtual Host entry in
 server.xml file.
 Tomcat/webapps-abc
 Tomcat/webapps-xyz
 
 These two web applications have different log4j.properties
 files.
 These log4j property files log to different log files
 (Tomcat/logs/abc.log and Tomcat/logs/xyz.log).
 Tomcat/webapps-abc/ROOT/WEB-INF/classes/log4j.properties
 Tomcat/webapps-xyz/ROOT/WEB-INF/classes/log4j.properties
 
 The web applications abc and xyz using Java Commons Logging
 API (Log
 and LogFactory classes) to perform logging.
 
 Scenario 1:
 log4j.jar is in Tomcat/lib directory
 log4j.jar is NOT in WEB-INF/lib directories
 
 Result:
 abc webapp's log entries are written to xyz.log file
 
 
 Scenario 2:
 log4j.jar is NOT in Tomcat/lib directory
 log4j.jar is in WEB-INF/lib directories
 
 Result:
 ClassNotFoundError in Tomcat/logs/catalina.log files
 
 
 Scenario 3:
 log4j.jar is in Tomcat/lib directory
 log4j.jar is in WEB-INF/lib directories
 
 Result:
 Empty abc.log and xyz.log files.
 
 
 Here's the relevant portion of the
 webapps-abc/ROOT/WEB-INF/web.xml file:
     listener
        
 listener-classorg.springframework.web.util.Log4jConfigListener/listener-class
     /listener
     context-param
        
 param-namelog4jConfigLocation/param-name
        
 param-value/WEB-INF/classes/log4j.properties/param-value
     /context-param
     context-param
        
 param-namelog4jExposeWebAppRoot/param-name
        
 param-valuefalse/param-value
     /context-param
     listener
        
 listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
       /listener
 
 
  webapps-xyz/ROOT/WEB-INF/web.xml file looks just the same
 
 /* webapps-abc/ROOT/WEB-INF/classes/log4j.properties */
 log4j.rootLogger=INFO, A2
 log4j.appender.A2=org.apache.log4j.RollingFileAppender
 log4j.appender.A2.layout=org.apache.log4j.PatternLayout
 log4j.appender.A2.layout.ConversionPattern=%d{ MMM dd /
 HH:mm:ss}
 %-5p - [%c] : %m %n
 log4j.appender.A2.File=c:/Tomcat6/logs/abc.log
 log4j.appender.A2.MaxFileSize=100KB
 log4j.appender.A2.MaxBackupIndex=4
 
 
 /* webapps-xyz/ROOT/WEB-INF/classes/log4j.properties */
 log4j.rootLogger=INFO, A1
 log4j.appender.A1=org.apache.log4j.RollingFileAppender
 log4j.appender.A1.layout=org.apache.log4j.PatternLayout
 log4j.appender.A1.layout.ConversionPattern=%d{ MMM dd /
 HH:mm:ss}
 %-5p - [%c] : %m %n
 log4j.appender.A1.File=c:/Tomcat6/logs/xyz.log
 log4j.appender.A1.MaxFileSize=100KB
 log4j.appender.A1.MaxBackupIndex=4
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-05 Thread André Warnier
That was a nice and concise write-up, well-worth of an article in the 
Tomcat FAQ/WIKI.
How to setup Tomcat with 3 virtual hosts, each with its own homepage 
and Manager (and other) applications, and its own logfiles.


My only minor remark :

Mark Eggers wrote:
...


Finally for my setup, I added 127.0.0.1 foo and 127.0.0.1 bar to my hosts file 
in WINNT\system32\drivers\etc (this is an upgraded Windows/2000 Professional 
machine).

Upon starting up this mess, /***/ all three hosts were visible at 
localhost:8080, foo:8080, and bar:8080 as you would expect.


At the /***/, I would insert from a browser running on the same machine.
Nothing to do with Tomcat really, but there are still quite a number of 
people out there confused by hostname lookup and IP routing stuff.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-05 Thread Nuno Faria
I was having a similar problem moving a Tomcat 5.5 configuration to 6.0.

Following this thread and reading the docs I created virtual hosts
using the same webapps dir (it is a development environment with CVS
and I would have to change many things to accomplish one webapp folder
per virtual host).

Using the examples on this thread it would be like this

Host name=localhost  appBase=webapps
 unpackWARs=true autoDeploy=false deployOnStartup=false
 xmlValidation=false xmlNamespaceAware=false
 /Host

Host name=foo  appBase=webapps
 unpackWARs=true autoDeploy=false deployOnStartup=false
 xmlValidation=false xmlNamespaceAware=false

Context path= docBase=foo reloadable=true /

/Host

Host name=bar  appBase=webapps
 unpackWARs=true autoDeploy=false deployOnStartup=false
 xmlValidation=false xmlNamespaceAware=false

Context path= docBase=bar reloadable=true /
/Host

with this I avoid full apps initialization on Tomcat Startup (I have
up to 20 and use !-- -- to comment the Host I am not workin on) and
I am able to treat each app under webapps as an independent host.

I suppose it is not a good set-up for a production environment but I
needed a quick set-up to start working ASAP and this seems to work
just fine.

On Wed, May 5, 2010 at 10:57 AM, André Warnier a...@ice-sa.com wrote:
 That was a nice and concise write-up, well-worth of an article in the Tomcat
 FAQ/WIKI.
 How to setup Tomcat with 3 virtual hosts, each with its own homepage and
 Manager (and other) applications, and its own logfiles.

 My only minor remark :

 Mark Eggers wrote:
 ...

 Finally for my setup, I added 127.0.0.1 foo and 127.0.0.1 bar to my hosts
 file in WINNT\system32\drivers\etc (this is an upgraded Windows/2000
 Professional machine).

 Upon starting up this mess, /***/ all three hosts were visible at
 localhost:8080, foo:8080, and bar:8080 as you would expect.

 At the /***/, I would insert from a browser running on the same machine.
 Nothing to do with Tomcat really, but there are still quite a number of
 people out there confused by hostname lookup and IP routing stuff.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-05 Thread Caldarale, Charles R
 From: Mark Eggers [mailto:its_toas...@yahoo.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 Note that I do not have any non-Tomcat jar in apache-tomcat-6.0.26
 besides JDBC jars at this point.

Which I suspect is key to solving the OP's problem.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-05 Thread Caldarale, Charles R
 From: Nuno Faria [mailto:nuno.m.fa...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 Following this thread and reading the docs I created virtual hosts
 using the same webapps dir

That's a really, really bad idea - the hosts can easily scribble on each other 
when expanding war files.  Don't do it, even in development.

 (it is a development environment with CVS and I would have
 to change many things to accomplish one webapp folder per
 virtual host).

Much better to spend the effort up front to do things the right way than have 
to always wonder if the cause of strange behavior is due to having an invalid 
configuration.

 Context path= docBase=foo reloadable=true /

As always, don't put Context elements in server.xml.  The above got you 
double deployment of the foo webapp, once as foo, once as the default.

Why do people invite problems when it's so easy to do things properly?

 Context path= docBase=bar reloadable=true /

Same comment as above.

 with this I avoid full apps initialization on Tomcat Startup

No, you don't - each app has to be initialized for each Host (or in your 
case, multiple times for each Host).  All you might have avoided is expanding 
the .war files, which for development purposes you didn't need in the first 
place.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-05 Thread Caldarale, Charles R
 From: Mark Eggers [mailto:its_toas...@yahoo.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 I just hacked together a quick example on Windows/XP Professional.

  That was a nice and concise write-up, well-worth of an article 
  in the Tomcat FAQ/WIKI.

I strongly second André's comment.  If it's not possible for you to put this in 
the FAQ, may one of us do it for you?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-05 Thread Joe Hansen
Mark, Chuck, Andre, and Charles, You guys rock!

Mark, I followed your recommendations and
1. I copied the virtual host webapps directories outside Tomcat.
c:/hosts/abc.local/webapps
c:/hosts/xyz.local/webapps
2. Copied the manager.xml to Tomcat/conf/Catalina/abc.local and
Tomcat/conf/Catalina/xyz.local. Also copied the manager web
application to c:/hosts/abc.local/webapps and
c:/hosts/xyz.local/webapps
3. I commented the following segment from abc.local/ROOT/WEB-INF/web.xml file
!--
listener

listener-classorg.springframework.web.util.Log4jConfigListener/listener-class
/listener
context-param
param-namelog4jConfigLocation/param-name
param-value/WEB-INF/classes/log4j.properties/param-value
/context-param
context-param
param-namelog4jExposeWebAppRoot/param-name
param-valuefalse/param-value
/context-param
--
4. Removed log4j.jar from Tomcat/lib directory and copied it to
abc.local/webapps/ROOT/WEB-INF/lib and
xyz.local/webapps/ROOT/WEB-INF/lib

I then restarted Tomcat. This DID NOT solve the issue complete though.

The MOST IMPORTANT step was to move all jar files EXCEPT THE FOLLOWING
jar files to WEB-INF/lib directory from Tomcat/lib directory:
annotations-api.jar
catalina.jar
catalina-*.jar
commons-dbcp.jar
commons-pool.jar
el-api.jar
jasper*.jar
jsp-api.jar
mail.jar
servlet-api.jar
tomcat*.jar
DATABASE-DRIVERS.jar

As previously thought, the Quartz jobs (that run every one hour) were
not part of the problem!

I could not have resolved this issue without your contribution! I am
very grateful for your kind help. :) Thank you all!

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Mark Thomas
On 04/05/2010 17:32, Joe Hansen wrote:
 Hey all,
 
 We are using Tomcat 6 on a Windows XP box. We have a web application
 named abc. It was initially in the c:\Tomcat\webapps directory. I then
 moved the c:\Tomcat\webapps\abc directory to c:\Tomcat\abc. I then
 changed the Tomcat/conf/server.xml file to reflect this change...
 Host name=abc.local appBase=abc
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
   Context path= docBase=
   ResourceLink global=jdbc/MySqlDatabase
 name=jdbc/MySqlDatabase type=javax.sql.DataSource /
   /Context
 /Host
 
 Though the web application itself works fine, the web application
 logging no longer works after this change! How do I get the log4j
 logging to work again? Please advice!

Put the web application back where it belongs. docBase==appBase is *not*
a valid configuration. As you have seen, things break if you do that.

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Thank you for the super quick reply Mark! We are using Java Spring.
The reason for moving the web application out of the webapps directory
was that the Spring Context Loader was loading twice. First because
its in the webapps directory. Secondly, because it is being referred
to by the Host entry in the server.xml file.

So how do I keep the web application out of Tomcat/webapps directory
make the docBase different from the appBase? Or is there a way to keep
the web application in the Tomcat/webapps directory and NOT have
Spring Context Loader load twice.

Please advice.

Thanks,
Joe



On Tue, May 4, 2010 at 10:36 AM, Mark Thomas ma...@apache.org wrote:
 On 04/05/2010 17:32, Joe Hansen wrote:
 Hey all,

 We are using Tomcat 6 on a Windows XP box. We have a web application
 named abc. It was initially in the c:\Tomcat\webapps directory. I then
 moved the c:\Tomcat\webapps\abc directory to c:\Tomcat\abc. I then
 changed the Tomcat/conf/server.xml file to reflect this change...
         Host name=abc.local appBase=abc
                       unpackWARs=true autoDeploy=true
                       xmlValidation=false xmlNamespaceAware=false
                       Context path= docBase=
                               ResourceLink global=jdbc/MySqlDatabase
 name=jdbc/MySqlDatabase type=javax.sql.DataSource /
                       /Context
         /Host

 Though the web application itself works fine, the web application
 logging no longer works after this change! How do I get the log4j
 logging to work again? Please advice!

 Put the web application back where it belongs. docBase==appBase is *not*
 a valid configuration. As you have seen, things break if you do that.

 Mark



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Mark Thomas
On 04/05/2010 17:43, Joe Hansen wrote:
 Thank you for the super quick reply Mark! We are using Java Spring.
 The reason for moving the web application out of the webapps directory
 was that the Spring Context Loader was loading twice. First because
 its in the webapps directory. Secondly, because it is being referred
 to by the Host entry in the server.xml file.
 
 So how do I keep the web application out of Tomcat/webapps directory
 make the docBase different from the appBase? Or is there a way to keep
 the web application in the Tomcat/webapps directory and NOT have
 Spring Context Loader load twice.

What was your server.xml before you moved it?

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Mark, Here's the server.xml before moving abc out of the webapps directory:

?xml version='1.0' encoding='utf-8'?
Server port=8005 shutdown=SHUTDOWN
  Listener className=org.apache.catalina.core.AprLifecycleListener
SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
/

GlobalNamingResources
Resource name=UserDatabase auth=Container
type=org.apache.catalina.UserDatabase
description=User database that can be updated and 
saved

factory=org.apache.catalina.users.MemoryUserDatabaseFactory
pathname=conf/tomcat-users.xml /
/GlobalNamingResources

  Service name=Catalina
Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
   maxThreads=150 scheme=https secure=true
   clientAuth=false sslProtocol=TLS /
Connector port=8009 protocol=AJP/1.3 redirectPort=443 /
Engine name=Catalina defaultHost=localhost
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/
  Host name=localhost appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host

  Host name=abc.local appBase=webapps/abc
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Context path= docBase=
/Context
  /Host

/Engine
  /Service
/Server

On Tue, May 4, 2010 at 10:53 AM, Mark Thomas ma...@apache.org wrote:
 On 04/05/2010 17:43, Joe Hansen wrote:
 Thank you for the super quick reply Mark! We are using Java Spring.
 The reason for moving the web application out of the webapps directory
 was that the Spring Context Loader was loading twice. First because
 its in the webapps directory. Secondly, because it is being referred
 to by the Host entry in the server.xml file.

 So how do I keep the web application out of Tomcat/webapps directory
 make the docBase different from the appBase? Or is there a way to keep
 the web application in the Tomcat/webapps directory and NOT have
 Spring Context Loader load twice.

 What was your server.xml before you moved it?

 Mark



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Mark Thomas
On 04/05/2010 17:59, Joe Hansen wrote:
 Mark, Here's the server.xml before moving abc out of the webapps directory:
 
 Host name=abc.local appBase=webapps/abc
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
   Context path= docBase=
   /Context
 /Host

And therein lies the problem. docBase= is not valid.


Currently, your app is deployed once under localhost with context path
/abc and is partially deployed under abc.local with context path .
Additionally, every directory under webapps/abc will be deployed as a
web application under abc.local

Quite a mess.

What is it you are trying to achieve?

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
   Host name=localhost appBase=webapps
   /Host
 
 Host name=abc.local appBase=webapps/abc

First problem: overlapping appBase settings for multiple Host elements.  They 
must be distinct.

   Context path= docBase=
   /Context

Second problem: a completely invalid Context setting, plus it's in 
server.xml, which is inappropriate.

If you want a second Host (do you really need one?), and you want to specify 
a default webapp for it, create a separate directory for that Host's appBase, 
and place the desired webapp in ROOT (or ROOT.war) under that directory.  Note 
that the name ROOT is case-sensitive, even on Windows.

You do not need a Context element at all for this simple case.  Should the 
webapp evolve to where it does need a Context, it should be placed in 
ROOT/META-INF/context.xml.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Thanks for the reply, Mark. You made me understand the mess I have created.

I have written two web applications abc and xyz. I have mapped
abc.local and xyz.local to my machine's IP Address in my Windows HOST
file. So when I visit http://abc.local, I would want the abc web
application to be accessed. When I visit http://xyz.local, I would
want the xyz web application to be accessed. This is what I have been
trying to achieve. Apparently I have been doing this the wrong way.
Looks like I have some reading to do! Will post back after I read some
Tomcat documentation.

Thanks again!
Joe



On Tue, May 4, 2010 at 11:13 AM, Mark Thomas ma...@apache.org wrote:
 On 04/05/2010 17:59, Joe Hansen wrote:
 Mark, Here's the server.xml before moving abc out of the webapps directory:

         Host name=abc.local appBase=webapps/abc
                       unpackWARs=true autoDeploy=true
                       xmlValidation=false xmlNamespaceAware=false
                       Context path= docBase=
                       /Context
         /Host

 And therein lies the problem. docBase= is not valid.


 Currently, your app is deployed once under localhost with context path
 /abc and is partially deployed under abc.local with context path .
 Additionally, every directory under webapps/abc will be deployed as a
 web application under abc.local

 Quite a mess.

 What is it you are trying to achieve?

 Mark



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: RE: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 Looks like I have some reading to do! Will post back after 
 I read some Tomcat documentation.

Start here:

http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Many Thanks for the link Chuck! Here's what I did.

1. Created a directory named c:\Tomcat\abc\ROOT.
2. Moved the previous contents of c:\Tomcat\webapps\abc to
c:\Tomcat\abc\ROOT directory.
3. Created c:\Tomcat\abc\ROOT\META-INF\context.xml. Here's that file.
?xml version=1.0 encoding=UTF-8?
Context
ResourceLink global=jdbc/ProgressDatabase
name=jdbc/ProgressDatabase type=javax.sql.DataSource /
/Context
4. Changed c:\Tomcat\conf\server.xml to
Host name=localhost appBase=webapps unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
/Host

Host name=abc.local appBase=abc unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
/Host

End Result is:
1. Spring Context loader is loaded only once (Great!).
2. But the web application logging is working wierdly.The log entries
are written to c:\Tomcat\logs\xyz.log (i.e. the xyz web application's
log)  instead of writing to c:\Tomcat\logs\abc.log. .

Here's the c:\Tomcat\abc\ROOT\WEB-INF\classes\log4j.properties file.

log4j.rootLogger=INFO, A2
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A2.File=c:/Tomcat6/logs/trestlewood.log
log4j.appender.A2.MaxFileSize=100KB
log4j.appender.A2.MaxBackupIndex=4

Please advise!

Thank you!
Joe

On Tue, May 4, 2010 at 11:30 AM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: RE: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 Looks like I have some reading to do! Will post back after
 I read some Tomcat documentation.

 Start here:

 http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
 MATERIAL and is thus for use only by the intended recipient. If you received 
 this in error, please contact the sender and delete the e-mail and its 
 attachments from all computers.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread André Warnier

Joe Hansen wrote:

Many Thanks for the link Chuck! Here's what I did.

1. Created a directory named c:\Tomcat\abc\ROOT.
2. Moved the previous contents of c:\Tomcat\webapps\abc to
c:\Tomcat\abc\ROOT directory.

...

Let me throw in my grain of salt.
I like things organised in a logical way, with a structure that 
immediately makes it clear to anyone what one is trying to achieve.  And 
I like to have things that are logically at the same level, to also look 
that way at the physical level if possible.

Your mileage may vary as they say, but I would do as follows :

The basic Tomcat, which as downloaded and installed from the one and 
only original and genuine site, is structured as follows :


C:/tomcat : top installation dir   (*)
  |
  --- bin : the programs
  --- conf : the configuration files
  --- lib : common things
  --- webapps : standard and example applications
+ maybe your applications
  |
  --- ROOT : the standard default application
  --- etc..

Nice, clear, clean, matches the documentation etc..

In your server.xml, there is a single Host defined, it answers to the 
name localhost, and it is also the default host, which means that if 
some DNS hostname evaluates to the IP address of your host computer, 
then any request addressed to that DNS hostname will be processed 
according to the setup of that Host.


To indicate that the web applications for that host live under 
c:/tomcat/webapps, there is the appBase attribute of the Host tag :

Host name=localhost appBase=webapps
webapps being relative and thus interpreted as a subdirectory of the 
tomcat running directory, or CATALINA_BASE, which itself by default is 
the same as CATALINA_HOME, which is the tomcat installation directory 
c:/tomcat.


Now you add two web applications abc and xyz.
The normal place would be to install these under c:/tomcat/webapps/abc 
and c:/tomcat/webapps/xyz.

But then, you would have to access them via URLs like
http://hostname:port/abc
http://hostname:port/xyz

Instead, you would like to access them as respectively
http://abc.local/
http://xyz.local

That requires 2 parts :

1) you have to make abc.local and xyz.local into DNS aliases evaluating 
to the same IP address as your physical host.

That, you did already, in part.

2) you have to make each of these applications be the default 
application, so that you can call them without the prefix (abc or xyz).

That is a problem, because
  - there is already a ROOT application (the default Tomcat one)
  - abc and xyz cannot be both renamed to ROOT
So you decide to solve this by using virtual hosts.
Very good, that is one of the ways.

So we add 2 virtual host declarations to the Tomcat server.xml, for a 
total of 3 :

   Host namelocalhost appBase=webapps
...
   Host nameabc.local appBase=webapps-abc
...
   Host name=xyz.local appBase=webapps-xyz

and we change our basic directory layout to be :

C:/tomcat : top installation dir
  |
  --- bin : the programs
  --- conf : the configuration files
  --- lib : common things
  --- webapps : standard and example applications
+ maybe some of your applications
  |
  --- ROOT : the standard default application
  --- webapps-abc : the applications of the abc.local host
  |
  |-- ROOT : the default application of the abc.local host
  --- webapps-xyz : the applications of the xyz.local host
  |
  |-- ROOT : the default application of the xyz.local host
  --- etc..

This way, you get to keep the standard and example applications of the 
original Tomcat, to test and play around with.  These will be called 
whenever there is a request to

http://localhost/
http://127.0.0.1/
http://anything/
  as long as anything evaluates to one of the IP addresses of your 
physical host, and there is no specific Host name=anything defined.
And whenever someone uses one of the names defined in a Host tag, they 
will be directed to the corresponding appBase applications.
Also, the appBase's do not overlap, and they are at the same level in 
the file hierarchy, which is easy to understand, conveys well the idea 
that they are two choices at the same level, simplifies permission 
settings, is easy for backups etc..


There are other techniques and layouts possible to achieve the same 
effect, but I would not in any case base one application under 
tomcat_dir/abc

and another one under
tomcat_dir/webapps/xyz
because I would find that confusing, and because I would not want the 
future Tomcat developers of version 9.3 to suddenly find that abc or 
xyz would be a cute name for a future indispensable Tomcat 
subdirectory to store whatever.
I would also not want my boss to get the idea that the real nice name 
for application abc should really be server, and make things really 
messy.



(*) In fact, it isn't.  It normally wants to install itself in some 
awfully chosen directory with plenty of spaces in the name, guaranteed 
to give you stomac acidity some 

Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Joe,

On 5/4/2010 1:26 PM, Joe Hansen wrote:
 I have written two web applications abc and xyz. I have mapped
 abc.local and xyz.local to my machine's IP Address in my Windows HOST
 file. So when I visit http://abc.local, I would want the abc web
 application to be accessed. When I visit http://xyz.local, I would
 want the xyz web application to be accessed. This is what I have been
 trying to achieve. Apparently I have been doing this the wrong way.
 Looks like I have some reading to do! Will post back after I read some
 Tomcat documentation.

You want this:

webapps/abc
webapps/abc/ROOT  -- this is your abc webapp
webapps/abc/ROOT/META-INF
webapps/abc/ROOT/META-INF/context.xml
webapps/xyz
webapps/xyz/ROOT -- this is your xyz webapp
webapps/xyz/ROOT/META-INF
webapps/xyz/ROOT/META-INF/context.xml

It looks like you don't have any custom configuration for your
Context, so you don't even need META-INF/context.xml files for either
of your webapps.

Set up two Hosts:

Engine defaultHost=abc
  Host name=abc appBase=webapps/abc autoDeploy=true
Aliasabc.local/Alias
  /Host

  Host name=xyz appBase=webapps/xyz autoDeploy=true
Aliasxyz.local/Alias
  /Host
/Engine

Many administrators would expect that CATALINA_BASE/webapps is the
auto-deployment directory for a standard setup, so maybe instead of the
above paths, you'd want to move webapps/xyz and webapps/abc outside
of CATALINA_BASE, and then refer to them appropriately from within
server.xml.

This should avoid double-deployment.

Basically, these are the best-practices for Tomcat configuration:

1. Never declare Context elements in server.xml
2. Use the default auto-deploy Host and put your webapps into the
appBase directory... remember to use ROOT as appropriately
3. If you don't want your webapps to be in the auto-deploy directory,
then use conf/[Service]/[Engine]/[webappname].xml to configure your
webapps instead.

Good luck,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvgfKwACgkQ9CaO5/Lv0PBj4wCfaCKJ2cQUT7a9kC6rzdIVcho5
pGUAnioMCN5xtZD7bYPHV+5AdCRCKaX0
=6FLu
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 You want this:
 
 webapps/abc
 webapps/abc/ROOT  -- this is your abc webapp
 webapps/abc/ROOT/META-INF
 webapps/abc/ROOT/META-INF/context.xml
 webapps/xyz
 webapps/xyz/ROOT -- this is your xyz webapp
 webapps/xyz/ROOT/META-INF
 webapps/xyz/ROOT/META-INF/context.xml

No, you don't want the above.  That has overlapping appBase directories.  As 
pointed out by both André and myself, keep them separate, at the same level of 
the directory hierarchy:

webapps
webapps/ROOT
webapps/examples
...
webapps-abc
webapps-abc/ROOT  -- this is your abc webapp
webapps-abc/ROOT/META-INF
webapps-abc/ROOT/META-INF/context.xml
webapps-xyz
webapps-xyz/ROOT -- this is your xyz webapp
webapps-xyz/ROOT/META-INF
webapps-xyz/ROOT/META-INF/context.xml

The above will preserve your existing Tomcat webapps.

 Set up two Hosts:
 Engine defaultHost=abc
   Host name=abc appBase=webapps/abc autoDeploy=true
 Aliasabc.local/Alias
   /Host
   Host name=xyz appBase=webapps/xyz autoDeploy=true
 Aliasxyz.local/Alias
   /Host
 /Engine

This destroys access to the Tomcat-supplied webapps, so don't do that.  Add the 
two new Host elements, but don't replace the existing one, and don't change 
what defaultHost points to - unless you really, really want the replacement to 
be the default.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Thanks Andre and Chuck.

Andre, I renamed Tomcat/abc/ to Tomcat/webapps-abc/ to keep the naming
consistent. The directory structure that you've advocated is exactly
the same as the one Chuck told me. And I have implemented that.

However, logging is still an issue. One webapp's log4j seems to stomp
over other webapp's log files. What could I be doing wrong?

Here are the log4j configuration files:
/* c:\Tomcat\webapps-abc\ROOT\WEB-INF\classes\log4j.properties */
log4j.rootLogger=INFO, A1
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A1.File=c:/Tomcat/logs/abc.log
log4j.appender.A1.MaxFileSize=100KB
log4j.appender.A1.MaxBackupIndex=4


/* c:\Tomcat\webapps-xyz\ROOT\WEB-INF\classes\log4j.properties */
log4j.rootLogger=INFO, A2
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A2.File=c:/Tomcat/logs/xyz.log
log4j.appender.A2.MaxFileSize=100KB
log4j.appender.A2.MaxBackupIndex=4

According to the following link,
http://stackoverflow.com/questions/217929/problem-with-commons-logging-log4j-setup-in-spring-webapp-with-tomcat-6
If you have multiple webapps on the server, then you'll need
discipline that each webapp's log initialization does not stomp on the
initialization of other webapps. Each webapp will need to use unique
Logger IDs, which can be accomplished with unique package names.

Thank you!
Joe

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 5/4/2010 4:08 PM, Caldarale, Charles R wrote:
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 You want this:

 webapps/abc
 webapps/abc/ROOT  -- this is your abc webapp
 webapps/abc/ROOT/META-INF
 webapps/abc/ROOT/META-INF/context.xml
 webapps/xyz
 webapps/xyz/ROOT -- this is your xyz webapp
 webapps/xyz/ROOT/META-INF
 webapps/xyz/ROOT/META-INF/context.xml
 
 No, you don't want the above.  That has overlapping appBase directories.

FWIW, it doesn't (given my proposed server.xml).

 As pointed out by both André and myself, keep them separate, at the same 
 level of the directory hierarchy:

I did note that this would be a good idea, since most people expect
CATALINA_BASE/webapps to be the auto-deployment directory and seeing
subdirs would be confusing at least.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvgihwACgkQ9CaO5/Lv0PBMgQCggnmxr8NRL/fe0Zo5ibYxZ4/U
8l0AnRAD7nMj4MbsC5NNEJOnsZK8j8Vp
=DuXA
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Pid
On 04/05/2010 18:59, Joe Hansen wrote:
 Many Thanks for the link Chuck! Here's what I did.
 
 1. Created a directory named c:\Tomcat\abc\ROOT.
 2. Moved the previous contents of c:\Tomcat\webapps\abc to
 c:\Tomcat\abc\ROOT directory.
 3. Created c:\Tomcat\abc\ROOT\META-INF\context.xml. Here's that file.
 ?xml version=1.0 encoding=UTF-8?
 Context
   ResourceLink global=jdbc/ProgressDatabase
 name=jdbc/ProgressDatabase type=javax.sql.DataSource /
 /Context
 4. Changed c:\Tomcat\conf\server.xml to
 Host name=localhost appBase=webapps unpackWARs=true
 autoDeploy=true xmlValidation=false xmlNamespaceAware=false
 /Host
 
 Host name=abc.local appBase=abc unpackWARs=true
 autoDeploy=true xmlValidation=false xmlNamespaceAware=false
 /Host
 
 End Result is:
 1. Spring Context loader is loaded only once (Great!).
 2. But the web application logging is working wierdly.The log entries
 are written to c:\Tomcat\logs\xyz.log (i.e. the xyz web application's
 log)  instead of writing to c:\Tomcat\logs\abc.log. .
 
 Here's the c:\Tomcat\abc\ROOT\WEB-INF\classes\log4j.properties file.
 
 log4j.rootLogger=INFO, A2
 log4j.appender.A2=org.apache.log4j.RollingFileAppender
 log4j.appender.A2.layout=org.apache.log4j.PatternLayout
 log4j.appender.A2.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
 %-5p - [%c] : %m %n
 log4j.appender.A2.File=c:/Tomcat6/logs/trestlewood.log
 log4j.appender.A2.MaxFileSize=100KB
 log4j.appender.A2.MaxBackupIndex=4

And what about the xyz one?


p


 Please advise!
 
 Thank you!
 Joe
 
 On Tue, May 4, 2010 at 11:30 AM, Caldarale, Charles R
 chuck.caldar...@unisys.com wrote:
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: RE: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 Looks like I have some reading to do! Will post back after
 I read some Tomcat documentation.

 Start here:

 http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
 MATERIAL and is thus for use only by the intended recipient. If you received 
 this in error, please contact the sender and delete the e-mail and its 
 attachments from all computers.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 However, logging is still an issue. One webapp's log4j seems to stomp
 over other webapp's log files. What could I be doing wrong?

Where is your log4j.jar located?  You should have one copy in each webapp's 
WEB-INF/lib directory.  If you've placed log4j.jar in a common location, I 
think it will use the properties of the first webapp that references it for all 
the webapps.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Chuck,

Initially I placed log4j-1.2.15.jar in the c:\Tomcat\lib directory
only. This resulted in abc webapp logging in the
c:\Tomcat\logs\xyz.log file.

When I copied the log4j-1.2.15.jar to
c:\Tomcat\webapps-abc\ROOT\WEB-INF\lib and
c:\Tomcat\webapps-xyz\ROOT\WEB-INF\lib directories, it created empty
abc.log and xyz.log files.

When I delete c:\Tomcat\lib\log4j-1.2.15.jar, I get Tomcat startup
errors (NoClassDefFoundError: org/apache/log4j/Category). Also empty
abc.log and xyz.log files are created.

Joe

On Tue, May 4, 2010 at 3:20 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 However, logging is still an issue. One webapp's log4j seems to stomp
 over other webapp's log files. What could I be doing wrong?

 Where is your log4j.jar located?  You should have one copy in each webapp's 
 WEB-INF/lib directory.  If you've placed log4j.jar in a common location, I 
 think it will use the properties of the first webapp that references it for 
 all the webapps.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
 MATERIAL and is thus for use only by the intended recipient. If you received 
 this in error, please contact the sender and delete the e-mail and its 
 attachments from all computers.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 Initially I placed log4j-1.2.15.jar in the c:\Tomcat\lib 
 directory only. This resulted in abc webapp logging in the
 c:\Tomcat\logs\xyz.log file.

As expected - first one in wins.

 When I copied the log4j-1.2.15.jar to
 c:\Tomcat\webapps-abc\ROOT\WEB-INF\lib and
 c:\Tomcat\webapps-xyz\ROOT\WEB-INF\lib directories, it
 created empty abc.log and xyz.log files.

That's a least a good start - the separate appenders created the desired files. 
 One presumes you expected the files to actually have something in them...

 When I delete c:\Tomcat\lib\log4j-1.2.15.jar, I get Tomcat startup
 errors (NoClassDefFoundError: org/apache/log4j/Category).

Let's see the complete stack trace for that error.

Do you have other classes in Tomcat's lib directory that are shared by the 
webapps, and do those classes attempt to do logging?  Unless you really need 
them to be shared, put those classes in each webapp's WEB-INF/lib or 
WEB-INF/classes directories.  Otherwise, you'll need to modify your code and 
have each webapp pass in or otherwise expose its logger to the methods of the 
common classes.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Chuck,

There are common classes in Tomcat/lib/ but they don't attempt to do
any logging. However, the abc Spring Web application does initialize a
Quartz object which runs once every hour and does some logging. I
don't know if that has any implications.

Thanks,
Joe

Here's the stack trace from catalina.log file...
INFO: Initializing log4j from
[C:\Tomcat6\webapps-abc\ROOT\WEB-INF\classes\log4j.properties]
May 4, 2010 4:06:53 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener
instance of class
org.springframework.web.context.ContextLoaderListener
java.lang.ExceptionInInitializerError
at 
org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at 
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at 
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@20f443 for
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@20f443 for
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.NoClassDefFoundError: org/apache/log4j/Category))
at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at 
org.springframework.web.context.ContextLoader.clinit(ContextLoader.java:146)
... 26 more
Caused by: org.apache.commons.logging.LogConfigurationException: No
suitable Log constructor [Ljava.lang.Class;@20f443 for
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.NoClassDefFoundError: org/apache/log4j/Category)
at 
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
... 30 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at 
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
... 31 more

Here's the stack trace from localhost.log file...
INFO: Initializing log4j from
[C:\Tomcat6\webapps-xyz\ROOT\WEB-INF\classes\log4j.properties]
May 4, 2010 4:06:54 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception 

Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Joe,

On 5/4/2010 1:59 PM, Joe Hansen wrote:
 2. But the web application logging is working wierdly.The log entries
 are written to c:\Tomcat\logs\xyz.log (i.e. the xyz web application's
 log)  instead of writing to c:\Tomcat\logs\abc.log. .
 
 Here's the c:\Tomcat\abc\ROOT\WEB-INF\classes\log4j.properties file.

Oh, I forgot to mention in my other message: you should put log4j.log
into your webapp's WEB-INF/lib directory and not share it between
webapps. Several reasons:

1. log4j can only be initialized in one way. You can re-initialize, but
that's not what you want.
2. Webapps ought to be self-contained, other than the APIs guaranteed to
be provided by the container.
3. Your webapp A might need a different version of log4j (or any other
library for that matter), and therefore they just can't share.

It's just a better idea to bundle the required libraries with your webapp.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvgfVAACgkQ9CaO5/Lv0PDG/ACeMCgC8sgx6u9do6yASUGESN25
tecAn3MwvXH7cqB75S6yUnSJfbv1GBaE
=ud2n
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Joe,

On 5/4/2010 6:15 PM, Joe Hansen wrote:
 There are common classes in Tomcat/lib/ but they don't attempt to do
 any logging.

Are you sure?

 However, the abc Spring Web application does initialize a
 Quartz object which runs once every hour and does some logging. I
 don't know if that has any implications.

It appears so:

 Here's the stack trace from catalina.log file...
 INFO: Initializing log4j from
 [C:\Tomcat6\webapps-abc\ROOT\WEB-INF\classes\log4j.properties]
 May 4, 2010 4:06:53 PM org.apache.catalina.core.StandardContext listenerStart
 SEVERE: Exception sending context initialized event to listener
 instance of class
 org.springframework.web.context.ContextLoaderListener
 java.lang.ExceptionInInitializerError
   at 
 org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)

[...]

 java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by
 org.apache.commons.logging.LogConfigurationException: No suitable Log
 constructor [Ljava.lang.Class;@20f443 for
 org.apache.commons.logging.impl.Log4JLogger (Caused by
 java.lang.NoClassDefFoundError: org/apache/log4j/Category))

Looks like you've got a common logging framework configured to use
log4j. If you use Spring and they use commons-logging, you need to:

1. Move spring.jar into WEB-INF/lib
2. Move commons-logging.jar into WEB-INF/lib

Basically, move everything your webapp needs into WEB-INF/lib.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvgnYYACgkQ9CaO5/Lv0PBeXwCfYQwTWJBVUg+fri9Wbz0/S/Tk
GI8An2kzGimP4qwxgLaqLPva5qYxe/hg
=mWKe
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Thanks for the reply, Charles!

When commons-logging.jar is present in Tomcat/lib and WEB-INF/lib
directories, I get the following error :
Invalid class loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.

Here's the complete stack trace:
2010 May 04 / 16:28:34 ERROR -
[org.springframework.web.context.ContextLoader] : Context
initialization failed
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' defined
in ServletContext resource [/WEB-INF/abc-jdbc.xml]: Invocation of init
method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.quartz.impl.StdSchedulerFactory]:
Constructor threw exception; nested exception is
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Invalid class
loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.
(Caused by org.apache.commons.logging.LogConfigurationException:
Invalid class loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.)
(Caused by org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Invalid class
loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.
(Caused by org.apache.commons.logging.LogConfigurationException:
Invalid class loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.))
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at 
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at 
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at 
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at 

RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 Oh, I forgot to mention in my other message: you should put log4j.log
 into your webapp's WEB-INF/lib directory

Presumably, you mean log4j.jar, not log4j.log - which we already told him to 
move.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.




RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 When commons-logging.jar is present in Tomcat/lib and WEB-INF/lib
 directories, I get the following error :

As you should.  As Chris said, put everything (including the spring jars) in 
each webapp's WEB-INF/lib directory, and as little as possible (preferably 
nothing) in Tomcat's lib directory.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
Chuck, please note that when commons-logging.jar is present only in
the WEB-INF/lib directory,
I get the following error:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

So, either I get
a) Invalid class loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.

or

b) java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

I am really stumped. I even tried the following:
Context
 loader delegate=“false”/
/Context
which the following link recommends.
http://www.richardrauser.com/index.php/2009/09/02/log4j-multiple-web-apps-common-lib-logging/
But that doesn't solve my issue.

Thanks,
Joe

On Tue, May 4, 2010 at 4:58 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory

 When commons-logging.jar is present in Tomcat/lib and WEB-INF/lib
 directories, I get the following error :

 As you should.  As Chris said, put everything (including the spring jars) in 
 each webapp's WEB-INF/lib directory, and as little as possible (preferably 
 nothing) in Tomcat's lib directory.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
 MATERIAL and is thus for use only by the intended recipient. If you received 
 this in error, please contact the sender and delete the e-mail and its 
 attachments from all computers.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread André Warnier

Joe Hansen wrote:

Chuck, please note that when commons-logging.jar is present only in
the WEB-INF/lib directory,
I get the following error:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

So, either I get
a) Invalid class loader hierarchy.  You have more than one version of
'org.apache.commons.logging.Log' visible, which is not allowed.

or

b) java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

Really adventuring into areas unknown to me here, but might there not by 
any chance be /another/ webapp, in which you did /not/ in that case give 
its own copy of the jar of its own ?

(like under server/webapps ?)


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Joe Hansen
This thread has grown too long. For anyone following this thread,
here's the summary:

Two web applications, each with a Virtual Host entry in server.xml file.
Tomcat/webapps-abc
Tomcat/webapps-xyz

These two web applications have different log4j.properties files.
These log4j property files log to different log files
(Tomcat/logs/abc.log and Tomcat/logs/xyz.log).
Tomcat/webapps-abc/ROOT/WEB-INF/classes/log4j.properties
Tomcat/webapps-xyz/ROOT/WEB-INF/classes/log4j.properties

The web applications abc and xyz using Java Commons Logging API (Log
and LogFactory classes) to perform logging.

Scenario 1:
log4j.jar is in Tomcat/lib directory
log4j.jar is NOT in WEB-INF/lib directories

Result:
abc webapp's log entries are written to xyz.log file


Scenario 2:
log4j.jar is NOT in Tomcat/lib directory
log4j.jar is in WEB-INF/lib directories

Result:
ClassNotFoundError in Tomcat/logs/catalina.log files


Scenario 3:
log4j.jar is in Tomcat/lib directory
log4j.jar is in WEB-INF/lib directories

Result:
Empty abc.log and xyz.log files.


Here's the relevant portion of the webapps-abc/ROOT/WEB-INF/web.xml file:
listener

listener-classorg.springframework.web.util.Log4jConfigListener/listener-class
/listener
context-param
param-namelog4jConfigLocation/param-name
param-value/WEB-INF/classes/log4j.properties/param-value
/context-param
context-param
param-namelog4jExposeWebAppRoot/param-name
param-valuefalse/param-value
/context-param
listener

listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
/listener


 webapps-xyz/ROOT/WEB-INF/web.xml file looks just the same

/* webapps-abc/ROOT/WEB-INF/classes/log4j.properties */
log4j.rootLogger=INFO, A2
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A2.File=c:/Tomcat6/logs/abc.log
log4j.appender.A2.MaxFileSize=100KB
log4j.appender.A2.MaxBackupIndex=4


/* webapps-xyz/ROOT/WEB-INF/classes/log4j.properties */
log4j.rootLogger=INFO, A1
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{ MMM dd / HH:mm:ss}
%-5p - [%c] : %m %n
log4j.appender.A1.File=c:/Tomcat6/logs/xyz.log
log4j.appender.A1.MaxFileSize=100KB
log4j.appender.A1.MaxBackupIndex=4

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory

2010-05-04 Thread Caldarale, Charles R
 From: Joe Hansen [mailto:joe.hansen...@gmail.com]
 Subject: Re: Log4j logging doesn't work when a web application is moved
 outside Tomcat/webapps directory
 
 Scenario 1:
 log4j.jar is in Tomcat/lib directory
 log4j.jar is NOT in WEB-INF/lib directories

Have you added *anything* else to Tomcat's lib directory?

 Scenario 3:
 log4j.jar is in Tomcat/lib directory
 log4j.jar is in WEB-INF/lib directories

You must never have the same classes located in more than one spot in a given 
branch of the classloader tree, so the above is not a valid configuration.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely duetoerror

2010-03-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 2/26/2010 3:54 PM, Caldarale, Charles R wrote:
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: log4j :ERROR LogMananger.repositorySelector was null 
 likely duetoerror
 
 4) Use jinfo, a program that comes with the JDK for sure, possibly
 with the JRE as well.
 
 It doesn't come with the JRE (only the JDK), and it has severe
 limitations on Windows (the OP's platform).  For example, you may
 only look at specific command-line settings, one at a time, and not
 system properties in general.

That's too bad: on *NIX, I can use it to grab all system properties as
well as show me those that were specified on the command-line, etc. :(

One more reason to run *NIX in production. And development. And pretty
much everywhere.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuNTZkACgkQ9CaO5/Lv0PCoGQCfemspeRXNuXDd7tdQchBMPZhR
HY4AoLAbRZMk24k6AA/cRTwPw5P+gJu6
=S0QL
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely due to error

2010-02-26 Thread Pid

On 26/02/2010 09:47, Christoph Kukulies wrote:

I'm turning to this mailing list now after I posted my problem to the
Opencms mailing list at opencms.org. And someone from that list gave me
a hint that my problem could possibly have something to do with the
folling citation:

http://mail-archives.apache.org/mod_mbox//logging-log4j-user/200804.mbox/%3c6d42962c-5db1-4acb-bb3a-d9d0d91e9...@apache.org%3e


This is the text I posted to the opencms list and I'm just repeating it
here:


Christoph P. Kukulies schrieb:
  We stop and start Tomcat6.0.10 and Apache2.2 every midnight during the
  backup of our intranet machine.
 
  Since a couple of days the first access in the morning, when the
  secretary wants to log into opencms, produces the error below:
 
 
  HTTP Status 500 -
 
  type Exception report
 
  message
 
  description The server encountered an internal error () that prevented
  it from fulfilling this request.
 
  exception
 
  org.opencms.main.CmsInitException: Critical error during OpenCms
  initialization: Unable to initialize the user driver.
  org.opencms.main.OpenCmsCore.getInstance(OpenCmsCore.java:290)
  org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:127)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
  note The full stack trace of the root cause is available in the Apache
  Tomcat/6.0.10 logs.
  Apache Tomcat/6.0.10


What happens if you use the latest Tomcat version (rather than one 
released in Feb 2007)?



p



  Looking into Tomcat/logs/stdout_20100226.log I see:
 
 
 
  
  The following critical error occurred:
  Critical error during OpenCms initialization: Unable to initialize the
  user driv
  er.
  Giving up, unable to start OpenCms.
  
  log4j:ERROR LogMananger.repositorySelector was null likely due to error
  in class
  reloading, using NOPLoggerRepository.
 
 
  Starting OpenCms, version 7.5.0 in web application ROOT
 
  Copyright (c) 2009 Alkacon Software GmbH
  OpenCms comes with ABSOLUTELY NO WARRANTY
  This is free software, and you are welcome to
  redistribute it under certain conditions.
  Please see the GNU Lesser General Public Licence for
  further details.
 


I would be glad if I could get some help on m problem getting solved here.

Thanks.

--
Christoph



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely due to error

2010-02-26 Thread Christoph Kukulies

Pid schrieb:

On 26/02/2010 09:47, Christoph Kukulies wrote:

I'm turning to this mailing list now after I posted my problem to the
Opencms mailing list at opencms.org. And someone from that list gave me
a hint that my problem could possibly have something to do with the
folling citation:

http://mail-archives.apache.org/mod_mbox//logging-log4j-user/200804.mbox/%3c6d42962c-5db1-4acb-bb3a-d9d0d91e9...@apache.org%3e 




This is the text I posted to the opencms list and I'm just repeating it
here:


Christoph P. Kukulies schrieb:
  We stop and start Tomcat6.0.10 and Apache2.2 every midnight during 
the

  backup of our intranet machine.
 
  Since a couple of days the first access in the morning, when the
  secretary wants to log into opencms, produces the error below:
 
 
  HTTP Status 500 -
 
  type Exception report
 
  message
 
  description The server encountered an internal error () that 
prevented

  it from fulfilling this request.
 
  exception
 
  org.opencms.main.CmsInitException: Critical error during OpenCms
  initialization: Unable to initialize the user driver.
  org.opencms.main.OpenCmsCore.getInstance(OpenCmsCore.java:290)
  org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:127)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
  note The full stack trace of the root cause is available in the 
Apache

  Tomcat/6.0.10 logs.
  Apache Tomcat/6.0.10


What happens if you use the latest Tomcat version (rather than one 
released in Feb 2007)?



p

Will possibly try that. But updating log4j would be less painful if that 
would solve the problem.
Curing problems simply by updating to a newer version could bring other 
unexpected problems.


--
Christoph


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely due to error

2010-02-26 Thread Mark Thomas

On 26/02/2010 09:47, Christoph Kukulies wrote:

I would be glad if I could get some help on m problem getting solved here.


http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html
org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely due to error

2010-02-26 Thread Christoph Kukulies

Mark Thomas schrieb:

On 26/02/2010 09:47, Christoph Kukulies wrote:
I would be glad if I could get some help on m problem getting solved 
here.


http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html
org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

Mark


Thanks. Great answer!
Will try that. Probably will have to try it on 6.0.24 now since I moved 
to that meanwhile. :)


--
Christoph

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely due to error

2010-02-26 Thread Christoph Kukulies

Mark Thomas schrieb:

On 26/02/2010 09:47, Christoph Kukulies wrote:
I would be glad if I could get some help on m problem getting solved 
here.


http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html
org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

Mark

Excuse me, just one question. Where does this

org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

go?

catalina.properties? Or is it passed on the commandline? (-D)

--
Christoph


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely due to error

2010-02-26 Thread Mark Thomas

On 26/02/2010 11:16, Christoph Kukulies wrote:

Mark Thomas schrieb:

On 26/02/2010 09:47, Christoph Kukulies wrote:

I would be glad if I could get some help on m problem getting solved
here.


http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html
org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

Mark

Excuse me, just one question. Where does this

org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

go?

catalina.properties? Or is it passed on the commandline? (-D)


I normally set in on the command line using the setenv.sh|bat file with
CATALINA_OPTS=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false

I think you can also set it in catalina.properties but I'd need to check 
that to be sure.


Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely due to error

2010-02-26 Thread Christoph Kukulies

Mark Thomas schrieb:

On 26/02/2010 11:16, Christoph Kukulies wrote:

Mark Thomas schrieb:

On 26/02/2010 09:47, Christoph Kukulies wrote:

I would be glad if I could get some help on m problem getting solved
here.


http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html
org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

Mark

Excuse me, just one question. Where does this

org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

go?

catalina.properties? Or is it passed on the commandline? (-D)


I normally set in on the command line using the setenv.sh|bat file with
CATALINA_OPTS=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false 



I think you can also set it in catalina.properties but I'd need to 
check that to be sure.


Mark

Since passing start parameters under Windows (service manager) is weird 
somehow I decided to put it

in catalina.properties and will see how it works out.

--
Christoph


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely due to error

2010-02-26 Thread Christoph Kukulies

Mark Thomas schrieb:

On 26/02/2010 11:16, Christoph Kukulies wrote:

Mark Thomas schrieb:

On 26/02/2010 09:47, Christoph Kukulies wrote:

I would be glad if I could get some help on m problem getting solved
here.


http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html
org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

Mark

Excuse me, just one question. Where does this

org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

go?

catalina.properties? Or is it passed on the commandline? (-D)


I normally set in on the command line using the setenv.sh|bat file with
CATALINA_OPTS=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false 



I think you can also set it in catalina.properties but I'd need to 
check that to be sure.


Mark

Is there a way to interrogate the running tomcat (catalina) process 
about it's set parameters?
I.e., I would like to control whether the setting in the 
catalina.properties file was fruitful :)


--
Christoph


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely due to error

2010-02-26 Thread André Warnier

Christoph Kukulies wrote:

Mark Thomas schrieb:

On 26/02/2010 11:16, Christoph Kukulies wrote:

Mark Thomas schrieb:

On 26/02/2010 09:47, Christoph Kukulies wrote:

I would be glad if I could get some help on m problem getting solved
here.


http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html
org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

Mark

Excuse me, just one question. Where does this

org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES

go?

catalina.properties? Or is it passed on the commandline? (-D)


I normally set in on the command line using the setenv.sh|bat file with
CATALINA_OPTS=-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false 



I think you can also set it in catalina.properties but I'd need to 
check that to be sure.


Mark

Is there a way to interrogate the running tomcat (catalina) process 
about it's set parameters?
I.e., I would like to control whether the setting in the 
catalina.properties file was fruitful :)



Have a look at : http://code.google.com/p/jmxsh/
(It's a generic tool, but quite practical for that kind of thing and more.)

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: log4j :ERROR LogMananger.repositorySelector was null likely due to error

2010-02-26 Thread Caldarale, Charles R
 From: Christoph Kukulies [mailto:k...@kukulies.org]
 Subject: Re: log4j :ERROR LogMananger.repositorySelector was null
 likely due to error
 
 Since passing start parameters under Windows (service manager) is weird

Use the Java tab of the tomcat6w.exe program to set startup parameters for the 
service.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: log4j :ERROR LogMananger.repositorySelector was null likely dueto error

2010-02-26 Thread Caldarale, Charles R
 From: Christoph Kukulies [mailto:k...@kukulies.org]
 Subject: Re: log4j :ERROR LogMananger.repositorySelector was null
 likely dueto error
 
 Is there a way to interrogate the running tomcat (catalina) process
 about it's set parameters?

1) Use JConsole (tricky with a service).

2) Install LambdaProbe and look at its System Information - System Properties 
page.

3) Write a trivial servlet that includes the following code:

Properties props = System.getProperties();
Object[] keys = props.keySet().toArray();

Arrays.sort(keys);

for (int i = 0; i  keys.length; i++) {
  response.getWriter().println(keys[i] + = + 
props.getProperty((String)keys[i]));
}

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: log4j :ERROR LogMananger.repositorySelector was null likely dueto error

2010-02-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 2/26/2010 9:13 AM, Caldarale, Charles R wrote:
 From: Christoph Kukulies [mailto:k...@kukulies.org]
 Subject: Re: log4j :ERROR LogMananger.repositorySelector was null
 likely dueto error

 Is there a way to interrogate the running tomcat (catalina) process
 about it's set parameters?
 
 1) Use JConsole (tricky with a service).
 
 2) Install LambdaProbe and look at its System Information - System 
 Properties page.
 
 3) Write a trivial servlet that includes the following code:

4) Use jinfo, a program that comes with the JDK for sure, possibly with
the JRE as well.

Usage: jinfo pid

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuIMs4ACgkQ9CaO5/Lv0PBJfACbB4iQB4lAMWj4db60EOzrRDM7
0lYAoJd4ZZLszlPgN/XsmiizICMsoXuk
=02Jq
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: log4j :ERROR LogMananger.repositorySelector was null likely duetoerror

2010-02-26 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: log4j :ERROR LogMananger.repositorySelector was null
 likely duetoerror
 
 4) Use jinfo, a program that comes with the JDK for sure, possibly with
 the JRE as well.

It doesn't come with the JRE (only the JDK), and it has severe limitations on 
Windows (the OP's platform).  For example, you may only look at specific 
command-line settings, one at a time, and not system properties in general.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



  1   2   3   >