Re: Tomcat DEBUG log4j and 5.5.4?

2004-12-03 Thread Jacob Kjome

Getting log4j logging running in Tomcat-5.5.x is pretty simple.  Here's what you
need...

1.  Put log4j.jar in common/lib
2.  Put commons-logging.jar (not commons-logging-api.jar!) in common/lib
3.  Put log4j.xml or log4j.properties in common/classes

You'll want to look at the new naming scheme for Host and Context loggers in the
5.5 docs.  Note that if you are using log4j-1.2.x, you can't use log4j.xml
because of the way the Host and Context loggers are named.  They use characters
that conflict with what the XML spec defines as allowed characters for an
attribute of type ID.  What I mean is the logger name attribute, which is
of type ID when using the DOMConfigurator.  Log4j-1.3 deprecates the
DOMConfigurator in favor of the JoranConfigurator which doesn't validate
against a DTD, so there is no conflict there.  For now, just use the properties
format. Here's a sample log4j.properties...

log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p[%-8.8t]: %39.39c %-6r - %m%n

#log4j.appender.A2=org.apache.log4j.FileAppender
#log4j.appender.A2.File=${catalina.home}/logs/stdout.log
#log4j.appender.A2.Append=false
#log4j.appender.A2.layout=org.apache.log4j.PatternLayout
#log4j.appender.A2.layout.ConversionPattern=%-5p[%-8.8t]: %39.39c %-6r - %m%n

log4j.appender.LOCALHOST=org.apache.log4j.RollingFileAppender
log4j.appender.LOCALHOST.File=${catalina.home}/logs/localhost.log
log4j.appender.LOCALHOST.MaxFileSize=1000KB
log4j.appender.LOCALHOST.MaxBackupIndex=1
log4j.appender.LOCALHOST.layout=org.apache.log4j.PatternLayout
log4j.appender.LOCALHOST.layout.ConversionPattern=%-5p[%-8.8t]: %39.39c %-6r -
%m%n

log4j.appender.SOMEAPP=org.apache.log4j.DailyRollingFileAppender
log4j.appender.SOMEAPP.File=${catalina.home}/logs/localhost_someapp.log
log4j.appender.SOMEAPP.DatePattern='.'-MM-dd
log4j.appender.SOMEAPP.layout=org.apache.log4j.PatternLayout
log4j.appender.SOMEAPP.layout.ConversionPattern=%c{1} %-6r - %m%n

log4j.appender.ANOTHERAPP=org.apache.log4j.DailyRollingFileAppender
log4j.appender.ANOTHERAPP.File=${catalina.home}/logs/localhost_anotherapp.log
log4j.appender.ANOTHERAPP.DatePattern='.'-MM-dd
log4j.appender.ANOTHERAPP.layout=org.apache.log4j.PatternLayout
log4j.appender.ANOTHERAPP.layout.ConversionPattern=%c{1} %-6r - %m%n


log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/someapp]=DEBUG,
SOMEAPP
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/someapp]=false

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/anotherapp]=INFO,
ANOTHERAPP
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/anotherapp]=false

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO,
LOCALHOST
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=false

log4j.rootLogger=INFO, A1



Jake


Quoting Kevin A. Burton [EMAIL PROTECTED]:

 http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html

 Does this actually work?  I followed the steps for log4j and it won't
 work at all. I still get the standard logging.  Are there any properties
 settings I can use to get more info on the bootstrap process?

 Kevin

 --

 Use Rojo (RSS/Atom aggregator).  Visit http://rojo.com. Ask me for an
 invite!  Also see irc.freenode.net #rojo if you want to chat.

 Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html

 If you're interested in RSS, Weblogs, Social Networking, etc... then you
 should work for Rojo!  If you recommend someone and we hire them you'll
 get a free iPod!

 Kevin A. Burton, Location - San Francisco, CA
AIM/YIM - sfburtonator,  Web - http://peerfear.org/
 GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412


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





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



RE: Tomcat and Log4J

2003-12-18 Thread Shapira, Yoav

Howdy,
I could rant on this issue for a long time, but I'll stick to three
points.

Thanks for the advice. I tried using Log4J directly by one of my
classes
and, like you said, it worked.

Ahh, good, a simple setup that works.

However, I wanted to stick with commons
logging since this is (supposedly) the most flexible logging solution.

Thank you for providing something funny in today's boring batch of
emails to this list.  ;)  Yes, let's take something simple that works
and replace it with something complicated that may or may not work after
some fidgeting and trial and error.

However, I am surprised that this was all necessary. I am also
surprised
that it is (I think) undocumented.

Undocumented?  Search this and the log4j-user list's archives for many
many many other people who've run into the same problems as you, and
worse.  You'll find many solutions, workaround, and black magic.  And
yes, I do consider the list archives as part of the documentation ;)

Yoav Shapira




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Tomcat and Log4J

2003-12-18 Thread Andy Eastham
Kent,

A gothcha to be aware of: if you put log4j.jar in common/lib, all webapps
will share the same log4j configuration.  This causes a race at server
startup - the last one to initialize log4j wins, ie gets it's own settings.
Everything else then logs into the same file.  This is a symptom of static
variables loaded by the same class loader, so all webapps share the same
instance of the static log4j variables.

I put log4j.jar in each of my webapps' WEB-INF/lib folder to avoid this,
then each webapp can configure log4j to it's own requirements.

Andy

-Original Message-
From: Kent Boogaart [mailto:[EMAIL PROTECTED] 
Sent: 18 December 2003 04:45
To: '[EMAIL PROTECTED]'
Subject: RE: Tomcat and Log4J

 Howdy, Your problem is not log4j, it's commons-logging, which is nearly
always the culprit. The issue arises if log4j is in a classloader below
commons-logging, so
 commons-logging doesn't know log4j is there. You're configuring log4j OK,
and if you used a log4j Logger rather than a commons-logging Log, you'd see
expected 
 behavior. But you're using a commons-logging Log, which uses the
commons-logging configuration, which is tied to your server and outputs to
the console. Yoav
 Shapira Millennium ChemInformatics 

Shapira,

Thanks for the advice. I tried using Log4J directly by one of my classes
and, like you said, it worked. However, I wanted to stick with commons
logging since this is (supposedly) the most flexible logging solution.
Therefore, I tried sticking log4j.jar into ${TOMCAT_HOME}/common/lib and
log4j.xml into ${TOMCAT_HOME}/common/classes. This worked for Tomcat classes
but not my own (my log output was still going to stdout). This had me
stumped.

After further stuffing around, one of my work collegues mentioned he'd
gotten around this problem by including commons-logging.jar and
commons-logging-api.jar in his web app. I tried this and it worked. I then
removed commons-logging-api.jar from my web app and it still worked.

In a way this all kind of makes sense - my web app has its own commons
logging package which finds the log4j package and the configuration.
However, I am surprised that this was all necessary. I am also surprised
that it is (I think) undocumented.

Anyways, thanks for your help.

Regards,
Kent

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




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



Re: Tomcat and Log4J

2003-12-17 Thread Lucian Comanescu
Hi Kent!

Our test environment it is exactly the same Tomcat 4.1.25/W2k, log4j 1.2.8
but we use the old-fashionate way to initialize log4j in a servlet'S init()
and setup the web.xml to load-on-startup one. And everything is working fine
... for almost an year.

Hope it's useful,
Lucian.

 All,
 
 I have been trying all day to get Tomcat and Log4J to cooperate. I have
 looked through many posts to this mailing list but have been unable to
 find
 any extra information that helps me.
 
 I am running Tomcat 4.1.27 on a Windows 2000 machine. My web app has
 log4j-1.2.8.jar in its WEB-INF/lib directory. I have a config file called
 log4j.xml in my WEB-INF directory. To load the configuration, I have a
 ContextStartupListener implementation with this code in it:
 
   //first things first - initialise the logging sub-system
   try {
   System.out.println(Initialising Log4J . . .);
   String configFile =
 WebAppContext.getContextParameter(log4j-config-file);
   
   //provide default
   if ((configFile == null) || (.equals(configFile.trim(
 {
   configFile = /WEB-INF/log4j.xml;
   }
   
   String filename =
 getServletContext().getRealPath(configFile);
   
   DOMConfigurator.configure(filename);
   System.out.println(. . . done);
   } catch (Throwable t) {
   System.err.println(Exception occurred:  + t);
   t.printStackTrace(new PrintWriter(System.err));
   }
   
   //now create the log
   log =

org.apache.commons.logging.LogFactory.getFactory().getInstance(StartupListen
 er.class);
 
   log.trace(trace enabled);
   log.debug(debug enabled);
   log.info(info enabled);
   log.warn(warn enabled);
   log.error(error enabled);
   log.fatal(fatal enabled);
 
 My log4j.xml file is defined as:
 
   ?xml version=1.0?
   !DOCTYPE log4j:configuration SYSTEM log4j.dtd
 
   log4j:configuration debug=false
 xmlns:log4j=http://jakarta.apache.org/log4j/;
   appender name=custom
 class=org.apache.log4j.DailyRollingFileAppender
   param name=File
 value=${CATALINA_HOME}/logs/custom.log/
   param name=DatePattern value='.'-MM-dd/
   
   layout class=org.apache.log4j.PatternLayout
   param name=ConversionPattern value=%d
 %-5p [%c] %m%n/
   /layout
   /appender
   
   root
   level value=debug/
   appender-ref ref=custom/
   /root
   /log4j:configuration
 
 As you can see, I have tried to redirect all logging for my webapp to a
 custom log file. If I set the log4j.debug system property to true, I can
 see
 that Log4J is successfully finding and using my configuration file.
 Indeed,
 the custom.log file is created. However, none of my log statements are
 directed to this file. Instead, they go straight to the console as per
 usual. Also, the debug level is the same as usual (ie. level is info
 instead
 of debug as specified in config file).
 
 What's really interesting is that there is some output in custom.log.
 However, this output belongs to JBoss client classes (my application
 utilises JBoss as an app server). Note that I am running Tomcat standalone
 -
 not as part of a JBoss installation. Here is a sample from custom.log:
 
   2003-12-17 14:54:13,653 DEBUG
 [org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] Extracting
 SpyConnectionFactory from reference
   2003-12-17 14:54:13,914 DEBUG
 [org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] The
 GenericConnectionFactory is:

GenericConnectionFactory:[EMAIL PROTECTED],conne
 ctionProperties={UIL_ADDRESS_KEY=203.8.163.174, PingPeriod=0,
 UIL_PORT_KEY=8096, ClientILService=org.jboss.mq.il.uil.UILClientILService,
 UIL_TCPNODELAY_KEY=yes}]
   2003-12-17 14:54:13,974 DEBUG [org.jboss.mq.Connection] Setting the
 clockDaemon's thread factory
   2003-12-17 14:54:14,024 DEBUG
 [org.jboss.mq.GenericConnectionFactory] Handing out ClientIL:
 org.jboss.mq.il.uil.UILClientILService
   2003-12-17 14:54:14,024 DEBUG
 [org.jboss.mq.il.uil.UILClientILService] UILClientILService.run()
   2003-12-17 14:54:14,134 DEBUG
 [org.jboss.mq.referenceable.SpyDestinationObjectFactory]
 SpyDestinationObjectFactory-getObjectInstance()
 
 It seems Log4J is being used for JBoss client classes but not for my own.
 What am I doing wrong here? I have also checked to ensure that
 ${CATALINA_HOME}/common/lib does not contain any logging-related JARs
 except
 for commons-logging-api.jar. Similarly, I have made sure that my web app
 does not contain any logging-related JARs except for log4j-1.2.8.jar.
 
 Sorry for the long post and thanks for even reading this far. I'd
 appreciate
 any 

RE: Tomcat and Log4J

2003-12-17 Thread Shapira, Yoav

Howdy,
Your problem is not log4j, it's commons-logging, which is nearly always
the culprit.  The issue arises if log4j is in a classloader below
commons-logging, so commons-logging doesn't know log4j is there.  You're
configuring log4j OK, and if you used a log4j Logger rather than a
commons-logging Log, you'd see expected behavior.  But you're using a
commons-logging Log, which uses the commons-logging configuration, which
is tied to your server and outputs to the console.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Kent Boogaart [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 12:07 AM
To: '[EMAIL PROTECTED]'
Subject: Tomcat and Log4J

All,

I have been trying all day to get Tomcat and Log4J to cooperate. I have
looked through many posts to this mailing list but have been unable to
find
any extra information that helps me.

I am running Tomcat 4.1.27 on a Windows 2000 machine. My web app has
log4j-1.2.8.jar in its WEB-INF/lib directory. I have a config file
called
log4j.xml in my WEB-INF directory. To load the configuration, I have a
ContextStartupListener implementation with this code in it:

   //first things first - initialise the logging sub-system
   try {
   System.out.println(Initialising Log4J . . .);
   String configFile =
WebAppContext.getContextParameter(log4j-config-file);

   //provide default
   if ((configFile == null) ||
(.equals(configFile.trim(
{
   configFile = /WEB-INF/log4j.xml;
   }

   String filename =
getServletContext().getRealPath(configFile);

   DOMConfigurator.configure(filename);
   System.out.println(. . . done);
   } catch (Throwable t) {
   System.err.println(Exception occurred:  + t);
   t.printStackTrace(new PrintWriter(System.err));
   }

   //now create the log
   log =
org.apache.commons.logging.LogFactory.getFactory().getInstance(StartupL
iste
n
er.class);

   log.trace(trace enabled);
   log.debug(debug enabled);
   log.info(info enabled);
   log.warn(warn enabled);
   log.error(error enabled);
   log.fatal(fatal enabled);

My log4j.xml file is defined as:

   ?xml version=1.0?
   !DOCTYPE log4j:configuration SYSTEM log4j.dtd

   log4j:configuration debug=false
xmlns:log4j=http://jakarta.apache.org/log4j/;
   appender name=custom
class=org.apache.log4j.DailyRollingFileAppender
   param name=File
value=${CATALINA_HOME}/logs/custom.log/
   param name=DatePattern
value='.'-MM-dd/

   layout class=org.apache.log4j.PatternLayout
   param name=ConversionPattern
value=%d
%-5p [%c] %m%n/
   /layout
   /appender

   root
   level value=debug/
   appender-ref ref=custom/
   /root
   /log4j:configuration

As you can see, I have tried to redirect all logging for my webapp to a
custom log file. If I set the log4j.debug system property to true, I
can
see
that Log4J is successfully finding and using my configuration file.
Indeed,
the custom.log file is created. However, none of my log statements are
directed to this file. Instead, they go straight to the console as per
usual. Also, the debug level is the same as usual (ie. level is info
instead
of debug as specified in config file).

What's really interesting is that there is some output in custom.log.
However, this output belongs to JBoss client classes (my application
utilises JBoss as an app server). Note that I am running Tomcat
standalone
-
not as part of a JBoss installation. Here is a sample from custom.log:

   2003-12-17 14:54:13,653 DEBUG
[org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory]
Extracting
SpyConnectionFactory from reference
   2003-12-17 14:54:13,914 DEBUG
[org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] The
GenericConnectionFactory is:
GenericConnectionFactory:[EMAIL PROTECTED],
conn
e
ctionProperties={UIL_ADDRESS_KEY=203.8.163.174, PingPeriod=0,
UIL_PORT_KEY=8096,
ClientILService=org.jboss.mq.il.uil.UILClientILService,
UIL_TCPNODELAY_KEY=yes}]
   2003-12-17 14:54:13,974 DEBUG [org.jboss.mq.Connection] Setting
the
clockDaemon's thread factory
   2003-12-17 14:54:14,024 DEBUG
[org.jboss.mq.GenericConnectionFactory] Handing out ClientIL:
org.jboss.mq.il.uil.UILClientILService
   2003-12-17 14:54:14,024 DEBUG
[org.jboss.mq.il.uil.UILClientILService] UILClientILService.run()
   2003-12-17 14:54:14,134 DEBUG
[org.jboss.mq.referenceable.SpyDestinationObjectFactory]
SpyDestinationObjectFactory-getObjectInstance()

It seems Log4J is being used for JBoss client classes but not for my
own.
What am I doing wrong here? I have also checked to ensure that
${CATALINA_HOME}/common/lib does not contain any logging-related JARs

RE: Tomcat and Log4J

2003-12-17 Thread Kent Boogaart
 Howdy, Your problem is not log4j, it's commons-logging, which is nearly
always the culprit. The issue arises if log4j is in a classloader below
commons-logging, so
 commons-logging doesn't know log4j is there. You're configuring log4j OK,
and if you used a log4j Logger rather than a commons-logging Log, you'd see
expected 
 behavior. But you're using a commons-logging Log, which uses the
commons-logging configuration, which is tied to your server and outputs to
the console. Yoav
 Shapira Millennium ChemInformatics 

Shapira,

Thanks for the advice. I tried using Log4J directly by one of my classes
and, like you said, it worked. However, I wanted to stick with commons
logging since this is (supposedly) the most flexible logging solution.
Therefore, I tried sticking log4j.jar into ${TOMCAT_HOME}/common/lib and
log4j.xml into ${TOMCAT_HOME}/common/classes. This worked for Tomcat classes
but not my own (my log output was still going to stdout). This had me
stumped.

After further stuffing around, one of my work collegues mentioned he'd
gotten around this problem by including commons-logging.jar and
commons-logging-api.jar in his web app. I tried this and it worked. I then
removed commons-logging-api.jar from my web app and it still worked.

In a way this all kind of makes sense - my web app has its own commons
logging package which finds the log4j package and the configuration.
However, I am surprised that this was all necessary. I am also surprised
that it is (I think) undocumented.

Anyways, thanks for your help.

Regards,
Kent

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



RE: tomcat 5.0.16 log4j wierd behaviour

2003-12-14 Thread Daniel

On Thu, 4 Dec 2003, Shapira, Yoav wrote:

 Howdy,

 When I deploy the webapp into /webapps/ then start tomcat, I get the
 error below--not when it loads my webapp--but when it loads the
 tomcat-docs webapp...??  So I copy the commons-logging.jar and
 log4j.jar into /commons/lib/ dir and the problem goes away, but is that
 how things should be done?  But I really want to keep my webapps as
 self-contained as possible...  Any pointers?

 There was nothing else in your message, i.e. no error. ;)

 Tomcat 5 uses the commons-logging api a lot more than tomcat 4.  Tomcat
 5 (and tomcat 4) don't use log4j directly (which I dislike, but that's
 another story).

 You shouldn't have to put log4j.jar and commons-logging.jar in
 common/lib.  You should be able to deploy in a completely self-contained
 manner: I have a bunch of applications using log4j deploying fine in
 tomcat 5, without adding anything to common/lib, just log4j.jar in
 WEB-INF/lib of each application.

 Perhaps your error message will shed more light...

 Yoav Shapira


Hi Yoav,

Yeah I thought that was the case...but it seems like my webapp and the
default ones that came with tomcat don't like each other, in regards to
logging.

I included the errors below.  I'm still having some really wierd
log4j errors that I'm not sure if it's coming from tomcat or turbine :(

snipped
INFO: Installing web application at context path  from URL
file:E:\Java\Software
\jakarta-tomcat-5.0.16\webapps\ROOT
Dec 14, 2003 1:45:28 PM org.apache.catalina.core.StandardHostDeployer
install
INFO: Error installing
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundExc
eption: org.apache.commons.logging.impl.Log4jFactory
at
org.apache.commons.logging.LogFactory$2.run(LogFactory.java:609)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561)

at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:298)

at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
at
org.apache.catalina.session.ManagerBase.init(ManagerBase.java:107)
at
org.apache.catalina.session.StandardManager.init(StandardManager.ja
va:111)
at
org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig
.java:350)
at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:65
5)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfi
g.java:254)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:166)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
212)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:866)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:85
0)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep
loyer.java:316)
at
org.apache.catalina.core.StandardHost.install(StandardHost.java:859)
at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j
ava:723)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473
)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:393)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:166)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)

at
org.apache.catalina.core.StandardHost.start(StandardHost.java:816)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)

at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518
)
at
org.apache.catalina.core.StandardService.start(StandardService.java:5
19)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:234
3)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.Log
4jFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at 

RE: tomcat 5.0.16 log4j wierd behaviour

2003-12-04 Thread Shapira, Yoav

Howdy,

When I deploy the webapp into /webapps/ then start tomcat, I get the
error below--not when it loads my webapp--but when it loads the
tomcat-docs webapp...??  So I copy the commons-logging.jar and
log4j.jar into /commons/lib/ dir and the problem goes away, but is that
how things should be done?  But I really want to keep my webapps as
self-contained as possible...  Any pointers?

There was nothing else in your message, i.e. no error. ;)

Tomcat 5 uses the commons-logging api a lot more than tomcat 4.  Tomcat
5 (and tomcat 4) don't use log4j directly (which I dislike, but that's
another story).

You shouldn't have to put log4j.jar and commons-logging.jar in
common/lib.  You should be able to deploy in a completely self-contained
manner: I have a bunch of applications using log4j deploying fine in
tomcat 5, without adding anything to common/lib, just log4j.jar in
WEB-INF/lib of each application.

Perhaps your error message will shed more light...

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: tomcat 5.0.16 log4j wierd behaviour

2003-12-04 Thread Daniel

Oops, it would help if I included the stack trace :)  See below...

On Thu, 4 Dec 2003, Daniel wrote:


 Hi everyone,

 I'm trying out the new tomcat 5.0.16 with a simple turbine 2.3 webapp that
 uses log4j.

 When I deploy the webapp into /webapps/ then start tomcat, I get the
 error below--not when it loads my webapp--but when it loads the
 tomcat-docs webapp...??  So I copy the commons-logging.jar and
 log4j.jar into /commons/lib/ dir and the problem goes away, but is that
 how things should be done?  But I really want to keep my webapps as
 self-contained as possible...  Any pointers?

 Thanks.
 Regards,
 Daniel

...all fine up to about this point...(notice Turbine app deployed fine,
and now tomcat is trying to deploy /tomcat-docs)...
snip
Dec 4, 2003 3:50:50 PM org.apache.turbine.Turbine init
INFO: Turbine: init() Ready to Rumble!
Dec 4, 2003 3:50:50 PM org.apache.catalina.core.StandardHostDeployer
install
INFO: Installing web application at context path /tomcat-docs from URL
file:C:\J
ava\Software\jakarta-tomcat-5.0.16\webapps\tomcat-docs
Dec 4, 2003 3:50:50 PM org.apache.catalina.core.StandardHostDeployer
install
INFO: Error installing
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundExc
eption: org.apache.commons.logging.impl.Log4jFactory
at
org.apache.commons.logging.LogFactory$2.run(LogFactory.java:609)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561)

at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:298)

at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
at
org.apache.catalina.session.ManagerBase.init(ManagerBase.java:107)
at
org.apache.catalina.session.StandardManager.init(StandardManager.ja
va:111)
at
org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig
.java:350)
at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:65
5)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfi
g.java:254)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:166)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
212)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:866)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:85
0)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep
loyer.java:316)
at
org.apache.catalina.core.StandardHost.install(StandardHost.java:859)
at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j
ava:723)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473
)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:393)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:166)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)

at
org.apache.catalina.core.StandardHost.start(StandardHost.java:816)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)

at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518
)
at
org.apache.catalina.core.StandardService.start(StandardService.java:5
19)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:234
3)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.logging.impl.Log
4jFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at
org.apache.commons.logging.LogFactory$2.run(LogFactory.java:607)
... 34 more
Dec 4, 2003 

Re: Tomcat Using Log4J ?

2003-08-25 Thread Hayo Schmidt
Bottom line is that, if you want Log4j logging to work properly, make sure 
log4j.jar is in WEB-INF/lib.
I had unwanted Debugging-Output from org.apache.commons.Digester and org.apache.commons.Digester.sax that made it impossible to continue to work. Everytime i started Tomcat i had to wait 10 minutes for the initialization of a tag library, because of that crap debug output.

This was the solution indeed. Thanks.

Hayo

Jacob Kjome schrieb:

Quoting Lukas Bradley [EMAIL PROTECTED]:

 

Does Tomcat 4.1.24 initialize a Log4J instance?  It seems as if something
 

is
   

stepping on my Log4J properties, and I don't know where it is.  The first
thing my application does is start the plugin, but here is my log:
 

It's actually Commons Digester.  When I set it to a DEBUG level, it goes
CRAZY on the log.
Is there any way to ensure that my log properties get set before Digester
starts?
   

That Depends.  Where do you have Log4j; in common/lib, WEB-INF/lib, or both?  
Is digester in your WEB-INF/lib or is it Tomcat's copy of digester which reads 
the server.xml and other xml config files?  Note that the trouble is usually 
the fault of commons-logging which messes things up significantly.  Do you have 
commons-logging in your WEB-INF/lib?

Bottom line is that, if you want Log4j logging to work properly, make sure 
log4j.jar is in WEB-INF/lib.  Then, nothing else will step on your 
configuration except for, possibly, other 3rd party libraries in WEB-INF/lib 
that perform Log4j configuration (which is a big no, no...general libraries 
shouldn't be performing Log4j configuration, they should leave that to your 
application).  Put your config file in WEB-INF/classes for default log4j 
configuration or put it wherever and load it yourself.  I suggest using a 
servlet context listener to load configuration upon startup.

Anway, until you detail the setup of your application, I can't tell you much 
more.

BTW, you really should remove Xerces from WEB-INF/lib.  This should be loaded 
from common/lib.  The explanation has been detailed on the list many times 
before so I won't go into it.

Jake

 

Lukas



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

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



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


Re: tomcat 4.1.27 log4j problem

2003-08-06 Thread Nathan Coast
if you use log4j on a tomcat-wide basis (ie 1 configuration for the 
tomcat runtime and all your webapps), place your log4j.xml in 
[tomcat-home]/shared/classes/

if you use log4j on a per-webapp basis, make sure the log4j classes 
aren't on the tomcat classpath and configure commons-logging to use jdk 
logging (assuming you are using jdk 1.4).

Zsolt Koppany wrote:

Hi,

my application uses log4j and with tomcat 4.1.27 (but not with 4.1.24) I
get the following error message:
log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.Digester).
log4j:WARN Please initialize the log4j system properly.
How can I fix this problem?

Zsolt



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



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


Re: tomcat 4.1.27 log4j problem

2003-08-06 Thread Zsolt Koppany
Thank you Nathan.

Zsolt


On Wed, 2003-08-06 at 12:15, Nathan Coast wrote:
 if you use log4j on a tomcat-wide basis (ie 1 configuration for the 
 tomcat runtime and all your webapps), place your log4j.xml in 
 [tomcat-home]/shared/classes/
 
 if you use log4j on a per-webapp basis, make sure the log4j classes 
 aren't on the tomcat classpath and configure commons-logging to use jdk 
 logging (assuming you are using jdk 1.4).
 
 Zsolt Koppany wrote:
 
  Hi,
  
  my application uses log4j and with tomcat 4.1.27 (but not with 4.1.24) I
  get the following error message:
  
  
  log4j:WARN No appenders could be found for logger
  (org.apache.commons.digester.Digester).
  log4j:WARN Please initialize the log4j system properly.
  
  How can I fix this problem?
  
  
  Zsolt
  
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



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



Re: Tomcat Using Log4J ?

2003-07-17 Thread Lukas Bradley
Thanks for all the information.  I tried removing Digester from WEB-INF/lib,
but then Struts isn't initializing properly.

For now, I also removed Xerces.

Here is a list of my WEB-INF/libs.

/WEB-INF/lib/activation.jar
/WEB-INF/lib/commons-beanutils.jar
/WEB-INF/lib/commons-collections.jar
/WEB-INF/lib/commons-dbcp.jar
/WEB-INF/lib/commons-fileupload.jar
/WEB-INF/lib/commons-lang.jar
/WEB-INF/lib/commons-pool.jar
/WEB-INF/lib/commons-resources.jar
/WEB-INF/lib/commons-services.jar
/WEB-INF/lib/commons-validator.jar
/WEB-INF/lib/dom.jar
/WEB-INF/lib/jakarta-oro.jar
/WEB-INF/lib/jaxen-full.jar
/WEB-INF/lib/jaxp-api.jar
/WEB-INF/lib/jdbc2_0-stdext.jar
/WEB-INF/lib/jdom.jar
/WEB-INF/lib/jstl.jar
/WEB-INF/lib/jta-spec1_0_1.jar
/WEB-INF/lib/log4j-1.2.7.jar
/WEB-INF/lib/mysql-connector-java-3.0.8-stable-bin.jar
/WEB-INF/lib/sax.jar
/WEB-INF/lib/saxpath.jar
/WEB-INF/lib/standard.jar
/WEB-INF/lib/struts.jar
/WEB-INF/lib/xalan.jar

Log4J is being loaded by a plugin detailed in Stuts.

Lukas

Jacob Kjome [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Quoting Lukas Bradley [EMAIL PROTECTED]:

   Does Tomcat 4.1.24 initialize a Log4J instance?  It seems as if
something
  is
   stepping on my Log4J properties, and I don't know where it is.  The
first
   thing my application does is start the plugin, but here is my log:
 
  It's actually Commons Digester.  When I set it to a DEBUG level, it goes
  CRAZY on the log.
 
  Is there any way to ensure that my log properties get set before
Digester
  starts?
 

 That Depends.  Where do you have Log4j; in common/lib, WEB-INF/lib, or
both?
 Is digester in your WEB-INF/lib or is it Tomcat's copy of digester which
reads
 the server.xml and other xml config files?  Note that the trouble is
usually
 the fault of commons-logging which messes things up significantly.  Do you
have
 commons-logging in your WEB-INF/lib?

 Bottom line is that, if you want Log4j logging to work properly, make sure
 log4j.jar is in WEB-INF/lib.  Then, nothing else will step on your
 configuration except for, possibly, other 3rd party libraries in
WEB-INF/lib
 that perform Log4j configuration (which is a big no, no...general
libraries
 shouldn't be performing Log4j configuration, they should leave that to
your
 application).  Put your config file in WEB-INF/classes for default log4j
 configuration or put it wherever and load it yourself.  I suggest using a
 servlet context listener to load configuration upon startup.

 Anway, until you detail the setup of your application, I can't tell you
much
 more.

 BTW, you really should remove Xerces from WEB-INF/lib.  This should be
loaded
 from common/lib.  The explanation has been detailed on the list many times
 before so I won't go into it.

 Jake

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




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



Re: Tomcat with log4j output

2003-07-16 Thread Johann Uhrmann
Abid Ali Teepo wrote:
Hi

I just added a servlet with logging done by log4j, and it apparently works ok.
But suddenly tomcat has started giving a lot of debug information. The thing is that 
even though i have set the level to info, it gives me tomcat debug.
Is there a setting or something i have awakened by log4j enabling my servlet ?
Where and how can i change this behaviour ?
Are You sure that the logger You set to info is also the logger You
write to?
If You use a control servlet in a different web application to change
log levels, there is a chance that You have two different instances
of Your logger.
Do You deploy the log4j-lib with the web application or do You have it
in common/lib?
(Putting it in common/lib might solve Your problem)
Kind regards,

Hans

--
Johann Uhrmann
xpecto AG | Lindenstrasse 81 | D-84030 Ergolding
Telefon: 0700 xpecto 00 (0700 973286 00)
Telefax: 0700 xpecto 10 (0700 973286 10)
Internet: http://www.xpecto.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Tomcat with log4j output

2003-07-16 Thread Abid Ali Teepo
Hi

As far as i know, i only have one logger and i have not put log4j jar in the 
common/lib i had it in my jdk/jre/ext

I tried to move it to common/lib now, but i still get the same output. So i'm getting 
tomcat debug info even though i never asked for it 

Is there any way i can override it ?

Abid

-Original Message-
From: Johann Uhrmann [mailto:[EMAIL PROTECTED]
Sent: 16. juli 2003 17:25
To: Tomcat Users List
Subject: Re: Tomcat with log4j output


Abid Ali Teepo wrote:
 Hi
 
 I just added a servlet with logging done by log4j, and it apparently works ok.
 But suddenly tomcat has started giving a lot of debug information. The thing is that 
 even though i have set the level to info, it gives me tomcat debug.
 
 Is there a setting or something i have awakened by log4j enabling my servlet ?
 Where and how can i change this behaviour ?

Are You sure that the logger You set to info is also the logger You
write to?

If You use a control servlet in a different web application to change
log levels, there is a chance that You have two different instances
of Your logger.

Do You deploy the log4j-lib with the web application or do You have it
in common/lib?
(Putting it in common/lib might solve Your problem)

Kind regards,

Hans


-- 
Johann Uhrmann
xpecto AG | Lindenstrasse 81 | D-84030 Ergolding
Telefon: 0700 xpecto 00 (0700 973286 00)
Telefax: 0700 xpecto 10 (0700 973286 10)
Internet: http://www.xpecto.com


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


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



RE: Tomcat with log4j output

2003-07-16 Thread Jacob Kjome
Never put Log4j in jdk/jre/ext.  You can put it in common/lib, but then also 
put it in the WEB-INF/lib of your webapp unless you are using a custom 
repository selector.  Otherwise, Log4j uses a single logger repository (the 
default one) and every app that performs configuration will override the 
configuration of previously configured apps.  Putting it in WEB-INF/lib will 
make it so you have a distinct logging environment and only that app will be 
configured in the default logger repository.

Jake

Quoting Abid Ali Teepo [EMAIL PROTECTED]:

 Hi
 
 As far as i know, i only have one logger and i have not put log4j jar in
 the common/lib i had it in my jdk/jre/ext
 
 I tried to move it to common/lib now, but i still get the same output. So i'm
 getting tomcat debug info even though i never asked for it 
 
 Is there any way i can override it ?
 
 Abid
 
 -Original Message-
 From: Johann Uhrmann [mailto:[EMAIL PROTECTED]
 Sent: 16. juli 2003 17:25
 To: Tomcat Users List
 Subject: Re: Tomcat with log4j output
 
 
 Abid Ali Teepo wrote:
  Hi
 
  I just added a servlet with logging done by log4j, and it apparently works
 ok.
  But suddenly tomcat has started giving a lot of debug information. The
 thing is that even though i have set the level to info, it gives me tomcat
 debug.
 
  Is there a setting or something i have awakened by log4j enabling my
 servlet ?
  Where and how can i change this behaviour ?
 
 Are You sure that the logger You set to info is also the logger You
 write to?
 
 If You use a control servlet in a different web application to change
 log levels, there is a chance that You have two different instances
 of Your logger.
 
 Do You deploy the log4j-lib with the web application or do You have it
 in common/lib?
 (Putting it in common/lib might solve Your problem)
 
 Kind regards,
 
 Hans
 
 
 --
 Johann Uhrmann
 xpecto AG | Lindenstrasse 81 | D-84030 Ergolding
 Telefon: 0700 xpecto 00 (0700 973286 00)
 Telefax: 0700 xpecto 10 (0700 973286 10)
 Internet: http://www.xpecto.com
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

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



RE: Tomcat with log4j output

2003-07-16 Thread Abid Ali Teepo
How come it has to be both in common/libs and in the WEB-INF ? 
What will i be missing if i only put it in WEB-INF ?

Abid

-Original Message-
From: Jacob Kjome [mailto:[EMAIL PROTECTED]
Sent: 16. juli 2003 17:57
To: Tomcat Users List
Subject: RE: Tomcat with log4j output


Never put Log4j in jdk/jre/ext.  You can put it in common/lib, but then also 
put it in the WEB-INF/lib of your webapp unless you are using a custom 
repository selector.  Otherwise, Log4j uses a single logger repository (the 
default one) and every app that performs configuration will override the 
configuration of previously configured apps.  Putting it in WEB-INF/lib will 
make it so you have a distinct logging environment and only that app will be 
configured in the default logger repository.

Jake

Quoting Abid Ali Teepo [EMAIL PROTECTED]:

 Hi
 
 As far as i know, i only have one logger and i have not put log4j jar in
 the common/lib i had it in my jdk/jre/ext
 
 I tried to move it to common/lib now, but i still get the same output. So i'm
 getting tomcat debug info even though i never asked for it 
 
 Is there any way i can override it ?
 
 Abid
 
 -Original Message-
 From: Johann Uhrmann [mailto:[EMAIL PROTECTED]
 Sent: 16. juli 2003 17:25
 To: Tomcat Users List
 Subject: Re: Tomcat with log4j output
 
 
 Abid Ali Teepo wrote:
  Hi
 
  I just added a servlet with logging done by log4j, and it apparently works
 ok.
  But suddenly tomcat has started giving a lot of debug information. The
 thing is that even though i have set the level to info, it gives me tomcat
 debug.
 
  Is there a setting or something i have awakened by log4j enabling my
 servlet ?
  Where and how can i change this behaviour ?
 
 Are You sure that the logger You set to info is also the logger You
 write to?
 
 If You use a control servlet in a different web application to change
 log levels, there is a chance that You have two different instances
 of Your logger.
 
 Do You deploy the log4j-lib with the web application or do You have it
 in common/lib?
 (Putting it in common/lib might solve Your problem)
 
 Kind regards,
 
 Hans
 
 
 --
 Johann Uhrmann
 xpecto AG | Lindenstrasse 81 | D-84030 Ergolding
 Telefon: 0700 xpecto 00 (0700 973286 00)
 Telefax: 0700 xpecto 10 (0700 973286 10)
 Internet: http://www.xpecto.com
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

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


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



RE: Tomcat with log4j output

2003-07-16 Thread Jacob Kjome
Quoting Abid Ali Teepo [EMAIL PROTECTED]:

 How come it has to be both in common/libs and in the WEB-INF ?
 What will i be missing if i only put it in WEB-INF ?
 
 Abid
 

It isn't that is *has* to be in common/lib.  You can have it only in WEB-
INF/lib and be just fine.  It *can* be in common/lib where it will be 
automagically used by commons-logging (the logging API that Tomcat uses) and if 
you were to use a custom repository selector, then you wouldn't need it in WEB-
INF/lib at all because your app would be using the globally accessible 
log4j.jar but using a distinct logger repository for each application so that 
you wouldn't have to worry about different app's log4j configuration 
conflicting.  Of course, as soon as an app depends on the default logger 
repository to be unique for itself, then you run into trouble, which is where 
the WEB-INF/lib idea will be far simpler to deal with.

Jake

 -Original Message-
 From: Jacob Kjome [mailto:[EMAIL PROTECTED]
 Sent: 16. juli 2003 17:57
 To: Tomcat Users List
 Subject: RE: Tomcat with log4j output
 
 
 Never put Log4j in jdk/jre/ext.  You can put it in common/lib, but then also
 put it in the WEB-INF/lib of your webapp unless you are using a custom
 repository selector.  Otherwise, Log4j uses a single logger repository (the
 default one) and every app that performs configuration will override the
 configuration of previously configured apps.  Putting it in WEB-INF/lib will
 make it so you have a distinct logging environment and only that app will be
 configured in the default logger repository.
 
 Jake
 
 Quoting Abid Ali Teepo [EMAIL PROTECTED]:
 
  Hi
 
  As far as i know, i only have one logger and i have not put log4j jar
 in
  the common/lib i had it in my jdk/jre/ext
 
  I tried to move it to common/lib now, but i still get the same output. So
 i'm
  getting tomcat debug info even though i never asked for it 
 
  Is there any way i can override it ?
 
  Abid
 
  -Original Message-
  From: Johann Uhrmann [mailto:[EMAIL PROTECTED]
  Sent: 16. juli 2003 17:25
  To: Tomcat Users List
  Subject: Re: Tomcat with log4j output
 
 
  Abid Ali Teepo wrote:
   Hi
  
   I just added a servlet with logging done by log4j, and it apparently
 works
  ok.
   But suddenly tomcat has started giving a lot of debug information. The
  thing is that even though i have set the level to info, it gives me tomcat
  debug.
  
   Is there a setting or something i have awakened by log4j enabling my
  servlet ?
   Where and how can i change this behaviour ?
 
  Are You sure that the logger You set to info is also the logger You
  write to?
 
  If You use a control servlet in a different web application to change
  log levels, there is a chance that You have two different instances
  of Your logger.
 
  Do You deploy the log4j-lib with the web application or do You have it
  in common/lib?
  (Putting it in common/lib might solve Your problem)
 
  Kind regards,
 
  Hans
 
 
  --
  Johann Uhrmann
  xpecto AG | Lindenstrasse 81 | D-84030 Ergolding
  Telefon: 0700 xpecto 00 (0700 973286 00)
  Telefax: 0700 xpecto 10 (0700 973286 10)
  Internet: http://www.xpecto.com
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

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



Re: Tomcat Using Log4J ?

2003-07-16 Thread Lukas Bradley
 Does Tomcat 4.1.24 initialize a Log4J instance?  It seems as if something
is
 stepping on my Log4J properties, and I don't know where it is.  The first
 thing my application does is start the plugin, but here is my log:

It's actually Commons Digester.  When I set it to a DEBUG level, it goes
CRAZY on the log.

Is there any way to ensure that my log properties get set before Digester
starts?

Lukas




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



Re: Tomcat Using Log4J ?

2003-07-16 Thread Jacob Kjome
Quoting Lukas Bradley [EMAIL PROTECTED]:

  Does Tomcat 4.1.24 initialize a Log4J instance?  It seems as if something
 is
  stepping on my Log4J properties, and I don't know where it is.  The first
  thing my application does is start the plugin, but here is my log:
 
 It's actually Commons Digester.  When I set it to a DEBUG level, it goes
 CRAZY on the log.
 
 Is there any way to ensure that my log properties get set before Digester
 starts?
 

That Depends.  Where do you have Log4j; in common/lib, WEB-INF/lib, or both?  
Is digester in your WEB-INF/lib or is it Tomcat's copy of digester which reads 
the server.xml and other xml config files?  Note that the trouble is usually 
the fault of commons-logging which messes things up significantly.  Do you have 
commons-logging in your WEB-INF/lib?

Bottom line is that, if you want Log4j logging to work properly, make sure 
log4j.jar is in WEB-INF/lib.  Then, nothing else will step on your 
configuration except for, possibly, other 3rd party libraries in WEB-INF/lib 
that perform Log4j configuration (which is a big no, no...general libraries 
shouldn't be performing Log4j configuration, they should leave that to your 
application).  Put your config file in WEB-INF/classes for default log4j 
configuration or put it wherever and load it yourself.  I suggest using a 
servlet context listener to load configuration upon startup.

Anway, until you detail the setup of your application, I can't tell you much 
more.

BTW, you really should remove Xerces from WEB-INF/lib.  This should be loaded 
from common/lib.  The explanation has been detailed on the list many times 
before so I won't go into it.

Jake

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

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



Re: tomcat and log4j

2003-07-02 Thread Dean A. Hoover
OK, so I changed the file to /tmp/xxx.log
and it still does not show up. Any other
suggestions?
Dean

Shapira, Yoav wrote:

Howdy,
You're not going to have file write access to xxx.log from inside a war.
Ensure the File parameter for your appender in log4j.properties points
to a writeable location.
Yoav Shapira
Millennium ChemInformatics
 

-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: Monday, June 30, 2003 8:03 PM
To: Tomcat Users List
Subject: Re: tomcat and log4j
Thanks for responding. I'm just going by what it says in the log4j
manual:
The default log4j initialization is particularly useful in web-server
environments. Under Tomcat 3.x and 4.x, you should place the
|log4j.properties| under the |WEB-INF/classes| directory of your
web-applications. Log4j will find the properties file and initialize
itself. This is easy to do and it works.
I am running jakarta-tomcat-4.1.24 on RH 9 using j2sdk1.4.1_02. I just
did a jar tvf on my
war file, which shows:
[EMAIL PROTECTED] vendor]$ jar tvf build/vendor.war
   0 Mon Jun 30 03:52:20 EDT 2003 META-INF/
 110 Mon Jun 30 03:52:20 EDT 2003 META-INF/MANIFEST.MF
   0 Wed May 14 01:06:28 EDT 2003 images/
   0 Mon Jun 30 01:48:54 EDT 2003 include/
   0 Mon Jun 30 13:26:16 EDT 2003 css/
1210 Wed May 14 01:06:28 EDT 2003 login.jsp
 485 Fri Jun 27 15:32:30 EDT 2003 welcome.jsp
3008 Wed May 14 01:06:28 EDT 2003 images/email2.png
15284 Wed May 14 01:06:28 EDT 2003 images/email.jpg
1678 Mon Jun 30 02:16:40 EDT 2003 register2.jsp
6861 Mon Jun 30 01:48:54 EDT 2003 include/contactinfo.jspf
2287 Wed May 14 01:06:28 EDT 2003 contact.html
 435 Fri Jun 27 15:38:58 EDT 2003 index.html
 856 Mon Jun 30 13:25:12 EDT 2003 css/default.css
1729 Mon Jun 30 01:55:04 EDT 2003 register1.jsp
1181 Mon Jun 30 01:54:14 EDT 2003 register3.jsp
   0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/
   0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/classes/
3526 Mon Jun 30 02:58:14 EDT 2003 WEB-INF/classes/Login.class
7268 Mon Jun 30 03:03:26 EDT 2003 WEB-INF/classes/Register.class
 333 Mon Jun 30 03:00:06 EDT 2003 WEB-INF/classes/log4j.properties
   0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/lib/
45386 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/activation.jar
305434 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/mail.jar
352668 Wed Jun 25 14:53:02 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
97589 Fri May 16 01:45:42 EDT 2003 WEB-INF/lib/universal-common.jar
12844 Fri Jun 27 03:06:54 EDT 2003 WEB-INF/lib/xxx.jar
352668 Mon Jun 30 03:52:06 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
1800 Wed May 21 09:53:30 EDT 2003 META-INF/context.xml
 496 Wed May 14 02:08:08 EDT 2003 WEB-INF/web.xml
This is what my log4j.properties file looks like:
log4j.rootLogger=DEBUG, roll
log4j.appender.roll=org.apache.log4j.RollingFileAppender
log4j.appender.roll.File=xxx.log
log4j.appender.roll.MaxFileSize=100KB
log4j.appender.roll.MaxBackupIndex=1
log4j.appender.roll.layout=org.apache.log4j.PatternLayout
log4j.appender.roll.layout.ConversionPattern=%d [%t] %-5p %F:%L - %m%n
Everything compiles. I've used log4j in non-web apps. I have log
   

statements
 

in my servlet, and I cannot find a log file anywhere. What's up with
that???
Yoav Shapira wrote:

   

Howdy,
It does work if you place logj4.properties in WEB-INF/classes and
 

log4j.jar in
   

WEB-INF/lib.  If you could please be a bit more explicity when you say
 

This
   

does not seem to be working perhaps I could help more.

Yoav Shapira

--- Dean A. Hoover [EMAIL PROTECTED] wrote:

 

I want to use log4j inside a tomcat application. According
to the log4j short manual, all I have to do is drop my
log4j.properties file into WEB-INF/classes and then I can
just use it. This does not seem to be working. Can someone
help?
Thanks.

Dean Hoover

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


   

=
Yoav Shapira
[EMAIL PROTECTED]
__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 

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





This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender.  Thank you.

-
To unsubscribe, e-mail: [EMAIL PROTECTED

RE: tomcat and log4j

2003-07-02 Thread Shapira, Yoav

Howdy,
Add -Dlog4j.debug=true to your JAVA_OPTS and check the tomcat logs.  If
log4j runs into errors you'll see them there.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 2:34 PM
To: Tomcat Users List
Subject: Re: tomcat and log4j

OK, so I changed the file to /tmp/xxx.log
and it still does not show up. Any other
suggestions?

Dean

Shapira, Yoav wrote:

Howdy,
You're not going to have file write access to xxx.log from inside a
war.
Ensure the File parameter for your appender in log4j.properties points
to a writeable location.

Yoav Shapira
Millennium ChemInformatics




-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: Monday, June 30, 2003 8:03 PM
To: Tomcat Users List
Subject: Re: tomcat and log4j

Thanks for responding. I'm just going by what it says in the log4j
manual:

The default log4j initialization is particularly useful in
web-server
environments. Under Tomcat 3.x and 4.x, you should place the
|log4j.properties| under the |WEB-INF/classes| directory of your
web-applications. Log4j will find the properties file and initialize
itself. This is easy to do and it works.

I am running jakarta-tomcat-4.1.24 on RH 9 using j2sdk1.4.1_02. I
just
did a jar tvf on my
war file, which shows:

[EMAIL PROTECTED] vendor]$ jar tvf build/vendor.war
0 Mon Jun 30 03:52:20 EDT 2003 META-INF/
  110 Mon Jun 30 03:52:20 EDT 2003 META-INF/MANIFEST.MF
0 Wed May 14 01:06:28 EDT 2003 images/
0 Mon Jun 30 01:48:54 EDT 2003 include/
0 Mon Jun 30 13:26:16 EDT 2003 css/
 1210 Wed May 14 01:06:28 EDT 2003 login.jsp
  485 Fri Jun 27 15:32:30 EDT 2003 welcome.jsp
 3008 Wed May 14 01:06:28 EDT 2003 images/email2.png
15284 Wed May 14 01:06:28 EDT 2003 images/email.jpg
 1678 Mon Jun 30 02:16:40 EDT 2003 register2.jsp
 6861 Mon Jun 30 01:48:54 EDT 2003 include/contactinfo.jspf
 2287 Wed May 14 01:06:28 EDT 2003 contact.html
  435 Fri Jun 27 15:38:58 EDT 2003 index.html
  856 Mon Jun 30 13:25:12 EDT 2003 css/default.css
 1729 Mon Jun 30 01:55:04 EDT 2003 register1.jsp
 1181 Mon Jun 30 01:54:14 EDT 2003 register3.jsp
0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/
0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/classes/
 3526 Mon Jun 30 02:58:14 EDT 2003 WEB-INF/classes/Login.class
 7268 Mon Jun 30 03:03:26 EDT 2003 WEB-INF/classes/Register.class
  333 Mon Jun 30 03:00:06 EDT 2003 WEB-INF/classes/log4j.properties
0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/lib/
45386 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/activation.jar
305434 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/mail.jar
352668 Wed Jun 25 14:53:02 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
97589 Fri May 16 01:45:42 EDT 2003 WEB-INF/lib/universal-common.jar
12844 Fri Jun 27 03:06:54 EDT 2003 WEB-INF/lib/xxx.jar
352668 Mon Jun 30 03:52:06 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
 1800 Wed May 21 09:53:30 EDT 2003 META-INF/context.xml
  496 Wed May 14 02:08:08 EDT 2003 WEB-INF/web.xml

This is what my log4j.properties file looks like:
log4j.rootLogger=DEBUG, roll

log4j.appender.roll=org.apache.log4j.RollingFileAppender
log4j.appender.roll.File=xxx.log
log4j.appender.roll.MaxFileSize=100KB
log4j.appender.roll.MaxBackupIndex=1
log4j.appender.roll.layout=org.apache.log4j.PatternLayout
log4j.appender.roll.layout.ConversionPattern=%d [%t] %-5p %F:%L -
%m%n

Everything compiles. I've used log4j in non-web apps. I have log


statements


in my servlet, and I cannot find a log file anywhere. What's up with
that???

Yoav Shapira wrote:



Howdy,
It does work if you place logj4.properties in WEB-INF/classes and


log4j.jar in


WEB-INF/lib.  If you could please be a bit more explicity when you
say


This


does not seem to be working perhaps I could help more.

Yoav Shapira

--- Dean A. Hoover [EMAIL PROTECTED] wrote:




I want to use log4j inside a tomcat application. According
to the log4j short manual, all I have to do is drop my
log4j.properties file into WEB-INF/classes and then I can
just use it. This does not seem to be working. Can someone
help?

Thanks.

Dean Hoover


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





=
Yoav Shapira
[EMAIL PROTECTED]

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


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







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






This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed

Re: tomcat and log4j

2003-07-02 Thread Dean A. Hoover
Did that, don't see any errors. How exactly does log4j know to
configure itself under tomcat, just by dropping the log4j.properties
file in the right place???
Shapira, Yoav wrote:

Howdy,
Add -Dlog4j.debug=true to your JAVA_OPTS and check the tomcat logs.  If
log4j runs into errors you'll see them there.
Yoav Shapira
Millennium ChemInformatics
 

-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 2:34 PM
To: Tomcat Users List
Subject: Re: tomcat and log4j
OK, so I changed the file to /tmp/xxx.log
and it still does not show up. Any other
suggestions?
Dean

Shapira, Yoav wrote:

   

Howdy,
You're not going to have file write access to xxx.log from inside a
 

war.
 

Ensure the File parameter for your appender in log4j.properties points
to a writeable location.
Yoav Shapira
Millennium ChemInformatics


 

-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: Monday, June 30, 2003 8:03 PM
To: Tomcat Users List
Subject: Re: tomcat and log4j
Thanks for responding. I'm just going by what it says in the log4j
manual:
The default log4j initialization is particularly useful in
   

web-server
 

environments. Under Tomcat 3.x and 4.x, you should place the
|log4j.properties| under the |WEB-INF/classes| directory of your
web-applications. Log4j will find the properties file and initialize
itself. This is easy to do and it works.
I am running jakarta-tomcat-4.1.24 on RH 9 using j2sdk1.4.1_02. I
   

just
 

did a jar tvf on my
war file, which shows:
[EMAIL PROTECTED] vendor]$ jar tvf build/vendor.war
  0 Mon Jun 30 03:52:20 EDT 2003 META-INF/
110 Mon Jun 30 03:52:20 EDT 2003 META-INF/MANIFEST.MF
  0 Wed May 14 01:06:28 EDT 2003 images/
  0 Mon Jun 30 01:48:54 EDT 2003 include/
  0 Mon Jun 30 13:26:16 EDT 2003 css/
1210 Wed May 14 01:06:28 EDT 2003 login.jsp
485 Fri Jun 27 15:32:30 EDT 2003 welcome.jsp
3008 Wed May 14 01:06:28 EDT 2003 images/email2.png
15284 Wed May 14 01:06:28 EDT 2003 images/email.jpg
1678 Mon Jun 30 02:16:40 EDT 2003 register2.jsp
6861 Mon Jun 30 01:48:54 EDT 2003 include/contactinfo.jspf
2287 Wed May 14 01:06:28 EDT 2003 contact.html
435 Fri Jun 27 15:38:58 EDT 2003 index.html
856 Mon Jun 30 13:25:12 EDT 2003 css/default.css
1729 Mon Jun 30 01:55:04 EDT 2003 register1.jsp
1181 Mon Jun 30 01:54:14 EDT 2003 register3.jsp
  0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/
  0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/classes/
3526 Mon Jun 30 02:58:14 EDT 2003 WEB-INF/classes/Login.class
7268 Mon Jun 30 03:03:26 EDT 2003 WEB-INF/classes/Register.class
333 Mon Jun 30 03:00:06 EDT 2003 WEB-INF/classes/log4j.properties
  0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/lib/
45386 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/activation.jar
305434 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/mail.jar
352668 Wed Jun 25 14:53:02 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
97589 Fri May 16 01:45:42 EDT 2003 WEB-INF/lib/universal-common.jar
12844 Fri Jun 27 03:06:54 EDT 2003 WEB-INF/lib/xxx.jar
352668 Mon Jun 30 03:52:06 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
1800 Wed May 21 09:53:30 EDT 2003 META-INF/context.xml
496 Wed May 14 02:08:08 EDT 2003 WEB-INF/web.xml
This is what my log4j.properties file looks like:
log4j.rootLogger=DEBUG, roll
log4j.appender.roll=org.apache.log4j.RollingFileAppender
log4j.appender.roll.File=xxx.log
log4j.appender.roll.MaxFileSize=100KB
log4j.appender.roll.MaxBackupIndex=1
log4j.appender.roll.layout=org.apache.log4j.PatternLayout
log4j.appender.roll.layout.ConversionPattern=%d [%t] %-5p %F:%L -
   

%m%n
 

Everything compiles. I've used log4j in non-web apps. I have log

   

statements

 

in my servlet, and I cannot find a log file anywhere. What's up with
that???
Yoav Shapira wrote:



   

Howdy,
It does work if you place logj4.properties in WEB-INF/classes and
 

log4j.jar in

   

WEB-INF/lib.  If you could please be a bit more explicity when you
 

say
 

 

This

   

does not seem to be working perhaps I could help more.

Yoav Shapira

--- Dean A. Hoover [EMAIL PROTECTED] wrote:



 

I want to use log4j inside a tomcat application. According
to the log4j short manual, all I have to do is drop my
log4j.properties file into WEB-INF/classes and then I can
just use it. This does not seem to be working. Can someone
help?
Thanks.

Dean Hoover

---
   

--
 

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

[EMAIL PROTECTED]
 



   

=
Yoav Shapira
[EMAIL PROTECTED]
__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

 

-
 

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

RE: tomcat and log4j

2003-07-02 Thread Shapira, Yoav

Howdy,
These are all log4j questions better suited to that list.  But since the
mutual tomcat/log4j interest is so common, it's alright to keep it here.

Log4j does a classpath resource lookup for /log4j.properties as part of
its default initialization procedure, as documented in the log4j manual.
There's no magic here ;)

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 3:30 PM
To: Tomcat Users List
Subject: Re: tomcat and log4j

Did that, don't see any errors. How exactly does log4j know to
configure itself under tomcat, just by dropping the log4j.properties
file in the right place???

Shapira, Yoav wrote:

Howdy,
Add -Dlog4j.debug=true to your JAVA_OPTS and check the tomcat logs.
If
log4j runs into errors you'll see them there.

Yoav Shapira
Millennium ChemInformatics




-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 2:34 PM
To: Tomcat Users List
Subject: Re: tomcat and log4j

OK, so I changed the file to /tmp/xxx.log
and it still does not show up. Any other
suggestions?

Dean

Shapira, Yoav wrote:



Howdy,
You're not going to have file write access to xxx.log from inside a


war.


Ensure the File parameter for your appender in log4j.properties
points
to a writeable location.

Yoav Shapira
Millennium ChemInformatics






-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: Monday, June 30, 2003 8:03 PM
To: Tomcat Users List
Subject: Re: tomcat and log4j

Thanks for responding. I'm just going by what it says in the log4j
manual:

The default log4j initialization is particularly useful in


web-server


environments. Under Tomcat 3.x and 4.x, you should place the
|log4j.properties| under the |WEB-INF/classes| directory of your
web-applications. Log4j will find the properties file and
initialize
itself. This is easy to do and it works.

I am running jakarta-tomcat-4.1.24 on RH 9 using j2sdk1.4.1_02. I


just


did a jar tvf on my
war file, which shows:

[EMAIL PROTECTED] vendor]$ jar tvf build/vendor.war
   0 Mon Jun 30 03:52:20 EDT 2003 META-INF/
 110 Mon Jun 30 03:52:20 EDT 2003 META-INF/MANIFEST.MF
   0 Wed May 14 01:06:28 EDT 2003 images/
   0 Mon Jun 30 01:48:54 EDT 2003 include/
   0 Mon Jun 30 13:26:16 EDT 2003 css/
1210 Wed May 14 01:06:28 EDT 2003 login.jsp
 485 Fri Jun 27 15:32:30 EDT 2003 welcome.jsp
3008 Wed May 14 01:06:28 EDT 2003 images/email2.png
15284 Wed May 14 01:06:28 EDT 2003 images/email.jpg
1678 Mon Jun 30 02:16:40 EDT 2003 register2.jsp
6861 Mon Jun 30 01:48:54 EDT 2003 include/contactinfo.jspf
2287 Wed May 14 01:06:28 EDT 2003 contact.html
 435 Fri Jun 27 15:38:58 EDT 2003 index.html
 856 Mon Jun 30 13:25:12 EDT 2003 css/default.css
1729 Mon Jun 30 01:55:04 EDT 2003 register1.jsp
1181 Mon Jun 30 01:54:14 EDT 2003 register3.jsp
   0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/
   0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/classes/
3526 Mon Jun 30 02:58:14 EDT 2003 WEB-INF/classes/Login.class
7268 Mon Jun 30 03:03:26 EDT 2003 WEB-INF/classes/Register.class
 333 Mon Jun 30 03:00:06 EDT 2003 WEB-INF/classes/log4j.properties
   0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/lib/
45386 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/activation.jar
305434 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/mail.jar
352668 Wed Jun 25 14:53:02 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
97589 Fri May 16 01:45:42 EDT 2003 WEB-INF/lib/universal-common.jar
12844 Fri Jun 27 03:06:54 EDT 2003 WEB-INF/lib/xxx.jar
352668 Mon Jun 30 03:52:06 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
1800 Wed May 21 09:53:30 EDT 2003 META-INF/context.xml
 496 Wed May 14 02:08:08 EDT 2003 WEB-INF/web.xml

This is what my log4j.properties file looks like:
log4j.rootLogger=DEBUG, roll

log4j.appender.roll=org.apache.log4j.RollingFileAppender
log4j.appender.roll.File=xxx.log
log4j.appender.roll.MaxFileSize=100KB
log4j.appender.roll.MaxBackupIndex=1
log4j.appender.roll.layout=org.apache.log4j.PatternLayout
log4j.appender.roll.layout.ConversionPattern=%d [%t] %-5p %F:%L -


%m%n


Everything compiles. I've used log4j in non-web apps. I have log




statements




in my servlet, and I cannot find a log file anywhere. What's up
with
that???

Yoav Shapira wrote:





Howdy,
It does work if you place logj4.properties in WEB-INF/classes and




log4j.jar in




WEB-INF/lib.  If you could please be a bit more explicity when you


say




This




does not seem to be working perhaps I could help more.

Yoav Shapira

--- Dean A. Hoover [EMAIL PROTECTED] wrote:






I want to use log4j inside a tomcat application. According
to the log4j short manual, all I have to do is drop my
log4j.properties file into WEB-INF/classes and then I can
just use it. This does not seem to be working. Can someone
help?

Thanks.

Dean Hoover


-
--


--


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


[EMAIL PROTECTED

Re: tomcat and log4j

2003-07-01 Thread Holger Klawitter
Am Dienstag, 1. Juli 2003 02:03 schrieb Dean A. Hoover:
 Thanks for responding. I'm just going by what it says in the log4j
 manual:

 The default log4j initialization is particularly useful in web-server
 environments. Under Tomcat 3.x and 4.x, you should place the

 |log4j.properties| under the |WEB-INF/classes| directory of your

 web-applications. Log4j will find the properties file and initialize
 itself. This is easy to do and it works.

 log4j.appender.roll=org.apache.log4j.RollingFileAppender
 log4j.appender.roll.File=xxx.log
 log4j.appender.roll.MaxFileSize=100KB
 log4j.appender.roll.MaxBackupIndex=1
 log4j.appender.roll.layout=org.apache.log4j.PatternLayout
 log4j.appender.roll.layout.ConversionPattern=%d [%t] %-5p %F:%L - %m%n

The file might be written to a weird directory or couldn't be written at all. 
You should try an absolute path, like

log4j.appender.roll.File=${catalina.home}/logs/xxx.log

Mit freundlichem Gruß / With kind regards
Holger Klawitter
--
lists at klawitter dot de


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



RE: tomcat and log4j

2003-07-01 Thread Shapira, Yoav

Howdy,
You're not going to have file write access to xxx.log from inside a war.
Ensure the File parameter for your appender in log4j.properties points
to a writeable location.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: Monday, June 30, 2003 8:03 PM
To: Tomcat Users List
Subject: Re: tomcat and log4j

Thanks for responding. I'm just going by what it says in the log4j
manual:

The default log4j initialization is particularly useful in web-server
environments. Under Tomcat 3.x and 4.x, you should place the
|log4j.properties| under the |WEB-INF/classes| directory of your
web-applications. Log4j will find the properties file and initialize
itself. This is easy to do and it works.

I am running jakarta-tomcat-4.1.24 on RH 9 using j2sdk1.4.1_02. I just
did a jar tvf on my
war file, which shows:

[EMAIL PROTECTED] vendor]$ jar tvf build/vendor.war
 0 Mon Jun 30 03:52:20 EDT 2003 META-INF/
   110 Mon Jun 30 03:52:20 EDT 2003 META-INF/MANIFEST.MF
 0 Wed May 14 01:06:28 EDT 2003 images/
 0 Mon Jun 30 01:48:54 EDT 2003 include/
 0 Mon Jun 30 13:26:16 EDT 2003 css/
  1210 Wed May 14 01:06:28 EDT 2003 login.jsp
   485 Fri Jun 27 15:32:30 EDT 2003 welcome.jsp
  3008 Wed May 14 01:06:28 EDT 2003 images/email2.png
 15284 Wed May 14 01:06:28 EDT 2003 images/email.jpg
  1678 Mon Jun 30 02:16:40 EDT 2003 register2.jsp
  6861 Mon Jun 30 01:48:54 EDT 2003 include/contactinfo.jspf
  2287 Wed May 14 01:06:28 EDT 2003 contact.html
   435 Fri Jun 27 15:38:58 EDT 2003 index.html
   856 Mon Jun 30 13:25:12 EDT 2003 css/default.css
  1729 Mon Jun 30 01:55:04 EDT 2003 register1.jsp
  1181 Mon Jun 30 01:54:14 EDT 2003 register3.jsp
 0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/
 0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/classes/
  3526 Mon Jun 30 02:58:14 EDT 2003 WEB-INF/classes/Login.class
  7268 Mon Jun 30 03:03:26 EDT 2003 WEB-INF/classes/Register.class
   333 Mon Jun 30 03:00:06 EDT 2003 WEB-INF/classes/log4j.properties
 0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/lib/
 45386 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/activation.jar
305434 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/mail.jar
352668 Wed Jun 25 14:53:02 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
 97589 Fri May 16 01:45:42 EDT 2003 WEB-INF/lib/universal-common.jar
 12844 Fri Jun 27 03:06:54 EDT 2003 WEB-INF/lib/xxx.jar
352668 Mon Jun 30 03:52:06 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
  1800 Wed May 21 09:53:30 EDT 2003 META-INF/context.xml
   496 Wed May 14 02:08:08 EDT 2003 WEB-INF/web.xml

This is what my log4j.properties file looks like:
log4j.rootLogger=DEBUG, roll

log4j.appender.roll=org.apache.log4j.RollingFileAppender
log4j.appender.roll.File=xxx.log
log4j.appender.roll.MaxFileSize=100KB
log4j.appender.roll.MaxBackupIndex=1
log4j.appender.roll.layout=org.apache.log4j.PatternLayout
log4j.appender.roll.layout.ConversionPattern=%d [%t] %-5p %F:%L - %m%n

Everything compiles. I've used log4j in non-web apps. I have log
statements
in my servlet, and I cannot find a log file anywhere. What's up with
that???

Yoav Shapira wrote:

Howdy,
It does work if you place logj4.properties in WEB-INF/classes and
log4j.jar in
WEB-INF/lib.  If you could please be a bit more explicity when you say
This
does not seem to be working perhaps I could help more.

Yoav Shapira

--- Dean A. Hoover [EMAIL PROTECTED] wrote:


I want to use log4j inside a tomcat application. According
to the log4j short manual, all I have to do is drop my
log4j.properties file into WEB-INF/classes and then I can
just use it. This does not seem to be working. Can someone
help?

Thanks.

Dean Hoover


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





=
Yoav Shapira
[EMAIL PROTECTED]

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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







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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: tomcat and log4j

2003-06-30 Thread Yoav Shapira
Howdy,
It does work if you place logj4.properties in WEB-INF/classes and log4j.jar in
WEB-INF/lib.  If you could please be a bit more explicity when you say This
does not seem to be working perhaps I could help more.

Yoav Shapira

--- Dean A. Hoover [EMAIL PROTECTED] wrote:
 I want to use log4j inside a tomcat application. According
 to the log4j short manual, all I have to do is drop my
 log4j.properties file into WEB-INF/classes and then I can
 just use it. This does not seem to be working. Can someone
 help?
 
 Thanks.
 
 Dean Hoover
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


=
Yoav Shapira
[EMAIL PROTECTED]

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: tomcat and log4j

2003-06-30 Thread Dean A. Hoover
Thanks for responding. I'm just going by what it says in the log4j
manual:
The default log4j initialization is particularly useful in web-server 
environments. Under Tomcat 3.x and 4.x, you should place the 
|log4j.properties| under the |WEB-INF/classes| directory of your 
web-applications. Log4j will find the properties file and initialize 
itself. This is easy to do and it works.

I am running jakarta-tomcat-4.1.24 on RH 9 using j2sdk1.4.1_02. I just 
did a jar tvf on my
war file, which shows:

[EMAIL PROTECTED] vendor]$ jar tvf build/vendor.war
0 Mon Jun 30 03:52:20 EDT 2003 META-INF/
  110 Mon Jun 30 03:52:20 EDT 2003 META-INF/MANIFEST.MF
0 Wed May 14 01:06:28 EDT 2003 images/
0 Mon Jun 30 01:48:54 EDT 2003 include/
0 Mon Jun 30 13:26:16 EDT 2003 css/
 1210 Wed May 14 01:06:28 EDT 2003 login.jsp
  485 Fri Jun 27 15:32:30 EDT 2003 welcome.jsp
 3008 Wed May 14 01:06:28 EDT 2003 images/email2.png
15284 Wed May 14 01:06:28 EDT 2003 images/email.jpg
 1678 Mon Jun 30 02:16:40 EDT 2003 register2.jsp
 6861 Mon Jun 30 01:48:54 EDT 2003 include/contactinfo.jspf
 2287 Wed May 14 01:06:28 EDT 2003 contact.html
  435 Fri Jun 27 15:38:58 EDT 2003 index.html
  856 Mon Jun 30 13:25:12 EDT 2003 css/default.css
 1729 Mon Jun 30 01:55:04 EDT 2003 register1.jsp
 1181 Mon Jun 30 01:54:14 EDT 2003 register3.jsp
0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/
0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/classes/
 3526 Mon Jun 30 02:58:14 EDT 2003 WEB-INF/classes/Login.class
 7268 Mon Jun 30 03:03:26 EDT 2003 WEB-INF/classes/Register.class
  333 Mon Jun 30 03:00:06 EDT 2003 WEB-INF/classes/log4j.properties
0 Mon Jun 30 03:52:22 EDT 2003 WEB-INF/lib/
45386 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/activation.jar
305434 Wed May 14 15:43:32 EDT 2003 WEB-INF/lib/mail.jar
352668 Wed Jun 25 14:53:02 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
97589 Fri May 16 01:45:42 EDT 2003 WEB-INF/lib/universal-common.jar
12844 Fri Jun 27 03:06:54 EDT 2003 WEB-INF/lib/xxx.jar
352668 Mon Jun 30 03:52:06 EDT 2003 WEB-INF/lib/log4j-1.2.8.jar
 1800 Wed May 21 09:53:30 EDT 2003 META-INF/context.xml
  496 Wed May 14 02:08:08 EDT 2003 WEB-INF/web.xml
This is what my log4j.properties file looks like:
log4j.rootLogger=DEBUG, roll
log4j.appender.roll=org.apache.log4j.RollingFileAppender
log4j.appender.roll.File=xxx.log
log4j.appender.roll.MaxFileSize=100KB
log4j.appender.roll.MaxBackupIndex=1
log4j.appender.roll.layout=org.apache.log4j.PatternLayout
log4j.appender.roll.layout.ConversionPattern=%d [%t] %-5p %F:%L - %m%n
Everything compiles. I've used log4j in non-web apps. I have log statements
in my servlet, and I cannot find a log file anywhere. What's up with that???
Yoav Shapira wrote:

Howdy,
It does work if you place logj4.properties in WEB-INF/classes and log4j.jar in
WEB-INF/lib.  If you could please be a bit more explicity when you say This
does not seem to be working perhaps I could help more.
Yoav Shapira

--- Dean A. Hoover [EMAIL PROTECTED] wrote:
 

I want to use log4j inside a tomcat application. According
to the log4j short manual, all I have to do is drop my
log4j.properties file into WEB-INF/classes and then I can
just use it. This does not seem to be working. Can someone
help?
Thanks.

Dean Hoover

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



=
Yoav Shapira
[EMAIL PROTECTED]
__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



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


Re: tomcat reloading log4j

2002-03-06 Thread Toru Watanabe

Hi!

this page might help you.
http://www.jguru.com/faq/view.jsp?EID=108773

regards,
Watanabe

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]