Re: tomcat and log4j, again

2003-07-03 Thread Vladimer Shioshvili
1. look into using fileappenders, or even better rolling file appenders.
2. in the log4j api find patternlayout. it has very good documentation.
d Used to output the date of the logging event. The date conversion 
specifier may be followed by a date format specifier enclosed between 
braces. For example, %d{HH:mm:ss,SSS} or %d{dd MMM  HH:mm:ss,SSS}. If 
no date format specifier is given then ISO8601 format is assumed.

The date format specifier admits the same syntax as the time pattern string 
of the 
http://java.sun.com/products/jdk/1.3/docs/api/java/text/SimpleDateFormat.htmlSimpleDateFormat. 
Although part of the standard JDK, the performance of SimpleDateFormat is 
quite poor.

For better results it is recommended to use the log4j date formatters. 
These can be specified using one of the strings ABSOLUTE, DATE and 
ISO8601 for specifying 
../../../org/apache/log4j/helpers/AbsoluteTimeDateFormat.htmAbsoluteTimeDateFormat, 
../../../org/apache/log4j/helpers/DateTimeDateFormat.htmDateTimeDateFormat 
and respectively 
../../../org/apache/log4j/helpers/ISO8601DateFormat.htmISO8601DateFormat. 
For example, %d{ISO8601} or %d{ABSOLUTE}.

These dedicated date formatters perform significantly better than 
http://java.sun.com/products/jdk/1.3/docs/api/java/text/SimpleDateFormat.htmlSimpleDateFormat. 

Hope this helps

At 12:54 PM 7/3/2003, you wrote:
OK, with my current configuration, I *am* seeing
output in catalina.out. However, its not formatted
the way I (think I) told it to. Also, I would
prefer to have the output go to a separate log
file, as there is just too much stuff in catalina.out
to wade through.
Anyway, I am using RH9, jakarta-tomcat-4.1.24,
and log4j-1.2.8. For my webapp, I am
creating a war file that has log4j.properties
in the WEB-INF/classes directory. I dropped
log4j-1.2.8.jar into the WEB-INF/lib directory.
The log4j.properties file looks like this:

log4j.logger.fermataintl.migrasponder=DEBUG, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d [%t] %-5p %F:%L - %m%n
=
I am not explicitly initializing log4j. A class that I am using
in my app invokes logging as follows:
package fermataintl.migrasponder.common;
import java.sql.*;
import org.apache.log4j.*;
public class Vendor
{
...
logger.warn(attempt to authenticate ' + id + ' failed);
...
private static Logger logger = Logger.getLogger(Vendor.class);
}
==
When I run my app and exercise the bit of code containing the
warning above, it puts the following in catalina.out:
1571947 [Thread-5] WARN common.Vendor  - attempt to authenticate 'xxx' failed
===
So... my questions are:
1) How do I get output to a file of my own choosing
2) How do I get the formatting to come out with date and time prepended?
Thanks.
Dean Hoover
PS. I looked for the commercial manual (on the website) at 2 local 
bookstores and on amazon.com. Nobody has it. I hesitate to order from
Switzerland, as I am in the US. How long would that take...

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

Vladimer Shioshvili
QRC Division of Macro International Inc.
7315 Wisconsin Avenue, Suite 400W
Bethesda, MD 20814
Phone: (301) 657 3077 ext. 155 

RE: tomcat and log4j, again

2003-07-03 Thread Shapira, Yoav

Howdy,

I am not explicitly initializing log4j. A class that I am using
in my app invokes logging as follows:

package fermataintl.migrasponder.common;
import java.sql.*;
import org.apache.log4j.*;

public class Vendor
{
...
 logger.warn(attempt to authenticate ' + id + ' failed);
...
 private static Logger logger = Logger.getLogger(Vendor.class);
}

The above can't compile: did you copy and paste it wrong?

1571947 [Thread-5] WARN common.Vendor  - attempt to authenticate 'xxx'
failed

Looks like the default layout, not the one you specified.

So... my questions are:

1) How do I get output to a file of my own choosing
2) How do I get the formatting to come out with date and time
prepended?

Use a FileAppender or one of its variants.  Specify the File attribute
such that it points to a writable directory/file.  Specify the Layout
for this FileAppender just like you did for the ConsoleAppender.  I
don't know why the layout for your console appender wasn't picked up,
since you've already said you don't see any errors ever in your logs
even with log4j.debug=true.

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, again

2003-07-03 Thread Vladimer Shioshvili
PS. WRAX press' Tomcat book has a section on Log4J. Pretty simple, 20 pages 
tops, but it will get you started. If you can get a handle of that, of course.

At 12:54 PM 7/3/2003, you wrote:
OK, with my current configuration, I *am* seeing
output in catalina.out. However, its not formatted
the way I (think I) told it to. Also, I would
prefer to have the output go to a separate log
file, as there is just too much stuff in catalina.out
to wade through.
Anyway, I am using RH9, jakarta-tomcat-4.1.24,
and log4j-1.2.8. For my webapp, I am
creating a war file that has log4j.properties
in the WEB-INF/classes directory. I dropped
log4j-1.2.8.jar into the WEB-INF/lib directory.
The log4j.properties file looks like this:

log4j.logger.fermataintl.migrasponder=DEBUG, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d [%t] %-5p %F:%L - %m%n
=
I am not explicitly initializing log4j. A class that I am using
in my app invokes logging as follows:
package fermataintl.migrasponder.common;
import java.sql.*;
import org.apache.log4j.*;
public class Vendor
{
...
logger.warn(attempt to authenticate ' + id + ' failed);
...
private static Logger logger = Logger.getLogger(Vendor.class);
}
==
When I run my app and exercise the bit of code containing the
warning above, it puts the following in catalina.out:
1571947 [Thread-5] WARN common.Vendor  - attempt to authenticate 'xxx' failed
===
So... my questions are:
1) How do I get output to a file of my own choosing
2) How do I get the formatting to come out with date and time prepended?
Thanks.
Dean Hoover
PS. I looked for the commercial manual (on the website) at 2 local 
bookstores and on amazon.com. Nobody has it. I hesitate to order from
Switzerland, as I am in the US. How long would that take...

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

Vladimer Shioshvili
QRC Division of Macro International Inc.
7315 Wisconsin Avenue, Suite 400W
Bethesda, MD 20814
Phone: (301) 657 3077 ext. 155 

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


Re: tomcat and log4j, again

2003-07-03 Thread Dean A. Hoover
Shapira, Yoav wrote:

Howdy,

 

I am not explicitly initializing log4j. A class that I am using
in my app invokes logging as follows:
package fermataintl.migrasponder.common;
import java.sql.*;
import org.apache.log4j.*;
public class Vendor
{
...
   logger.warn(attempt to authenticate ' + id + ' failed);
...
   private static Logger logger = Logger.getLogger(Vendor.class);
}
   

The above can't compile: did you copy and paste it wrong?

No, I just showed the important parts. Didn't figure anyone wanted to see
the entire file.
 

1571947 [Thread-5] WARN common.Vendor  - attempt to authenticate 'xxx'
failed
   

Looks like the default layout, not the one you specified.

Hmm. Maybe log4j just is never reading my properties file. I don't know why.

 

So... my questions are:

1) How do I get output to a file of my own choosing
2) How do I get the formatting to come out with date and time
   

prepended?

Use a FileAppender or one of its variants.  Specify the File attribute
such that it points to a writable directory/file.  Specify the Layout
for this FileAppender just like you did for the ConsoleAppender.  I
don't know why the layout for your console appender wasn't picked up,
since you've already said you don't see any errors ever in your logs
even with log4j.debug=true.
This is what I changed log4.properties to:

log4j.logger.fermataintl.migrasponder=DEBUG, l1
log4j.appender.l1=org.apache.log4j.FileAppender
log4j.appender.l1.File=/tmp/migrasponder
log4j.appender.l1.layout=org.apache.log4j.PatternLayout
log4j.appender.l1.layout.ConversionPattern=%d [%t] %-5p %F:%L - %m%n
===
I am still not seeing the log file show up. It just goes into 
catalina.out. I didn't
mean to imply that there were no errors in catalina.out. Actually, there 
seems
to be a bunch of stack traces, but none seem related to log4j. Is there some
public place that documents all of the ConversionPattern specifiers?

or should I just change to *using DateTimeDateFormat? And if so, can
you show me the specifics? Do you have any idea why the log file is
not being produced?
*
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]
 



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


Re: tomcat and log4j, again

2003-07-03 Thread Dean A. Hoover
Shapira, Yoav wrote:

Howdy,

 

This is what I changed log4.properties to:

log4j.logger.fermataintl.migrasponder=DEBUG, l1
log4j.appender.l1=org.apache.log4j.FileAppender
log4j.appender.l1.File=/tmp/migrasponder
log4j.appender.l1.layout=org.apache.log4j.PatternLayout
log4j.appender.l1.layout.ConversionPattern=%d [%t] %-5p %F:%L - %m%n
BTW, I changed the last line as follows:
log4j.appender.l1.layout.ConversionPattern=%d{-MM-dd HH:mm:ss} %-5p 
%F:%L - %m%n

   

That looks fine.

 

===
I am still not seeing the log file show up. It just goes into
catalina.out. I didn't
mean to imply that there were no errors in catalina.out. Actually,
   

there
 

seems
to be a bunch of stack traces, but none seem related to log4j. Is there
   

Don't assume that they're not relevant: can you please post them?

OK, here goes. I shutdown tomcat, removed catalina.out, and restarted. 
Here it is:

0 [main] INFO modeler.Registry  - Loading registry information
3 [main] INFO modeler.Registry  - Creating new Registry instance
449 [main] INFO modeler.Registry  - Creating MBeanServer
1217 [main] INFO http11.Http11Protocol  - Initializing Coyote HTTP/1.1 
on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.24
4932 [main] ERROR digester.Digester  - Parse Error at line 37 column 11: 
The content of element type web-app must match 
(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*).
org.xml.sax.SAXParseException: The content of element type web-app 
must match 
(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*).
   at 
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
Source)
   at 
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
   at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown 
Source)
   at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown 
Source)
   at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
Source)
   at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
   at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
   at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.commons.digester.Digester.parse(Digester.java:1543)
   at 
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:282)
   at 
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:639)
   at 
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:243)
   at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
   at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:3567)
   at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
   at 
org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
   at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
   at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
   at 
org.apache.catalina.core.StandardService.start(StandardService.java:497)
   at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
   at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
   at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:324)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
5283 [main] INFO http11.Http11Protocol  - Starting Coyote HTTP/1.1 on 
port 8080
5309 [main] INFO common.ChannelSocket  - JK2: ajp13 listening on 
/0.0.0.0:8009
5365 [main] 

RE: tomcat and log4j, again

2003-07-03 Thread Shapira, Yoav

Howdy,

OK, here goes. I shutdown tomcat, removed catalina.out, and restarted.
Here it is:
snip
4932 [main] ERROR digester.Digester  - Parse Error at line 37 column
11:
The content of element type web-app must match
(icon?,display-name?,description?,distributable?,context-
param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,sess
ion-
config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-e
nv-
ref*,resource-ref*,security-constraint*,login-config?,security-role*,en
v-
entry*,ejb-ref*,ejb-local-ref*).
snip
Any idea what all this nonsense is?

Far from nonsense, this is the cause for your problems and would've
saved us a few messages on both the tomcat-user and this list.  The
error message is clear, isn't it?  Your web.xml is not well-formed: fix
it, and everything should be OK.

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, again

2003-07-03 Thread Scott Burns

Following the discussion on this topic.  I am working on using the log4j
taglib for the presentation layer( jsps)

I also am not seeing anything in caltalina.out nor am not seeing a file
being created.  Any suggestions?  

# Sample properties to initialise log4j^M
log4j.debug=true^M

#log4j.rootCategory=debug, R^M
log4j.rootCategory=debug, stdout,R
^M
log4j.appender.stdout=org.apache.log4j.ConsoleAppender^M
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout^M
^M
# Pattern to output the caller's file name and line number.^M
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n^M
^M
log4j.appender.R=org.apache.log4j.RollingFileAppender^M
log4j.appender.R.File=/apps/tomcat/share/logs/taglib.log
^M
log4j.appender.R.MaxFileSize=100KB^M
# Keep one backup file^M
log4j.appender.R.MaxBackupIndex=2^M
^M
log4j.appender.R.layout=org.apache.log4j.PatternLayout^M
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n^M
^M
~ 

My WEB/INF/lib
@BLCUX02:/apps/tomcat/tomcat-worker1/webapps/log-examples/WEB-INF/libls
log4j-1.2.7.jar  taglibs-log.jar

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



Re: tomcat and log4j, again

2003-07-03 Thread Ceki Gülcü
At 12:54 PM 7/3/2003 -0400, Dean A. Hoover wrote:

PS. I looked for the commercial manual (on the website) at 2 local 
bookstores and on amazon.com. Nobody has it. I hesitate to order from
Switzerland, as I am in the US. How long would that take...
You can The complete log4j manual in the US from Softpro books:

  http://store.yahoo.com/softpro/2-9700369-0-8.html

They should have it in stock.

Otherwise, your hesitation about purchasing the book from Switzerland
is quite normal. Of course, much of the log4j code was written in
Switzerland as anyone can guess from the cheesy smell of the code.
People in Switzerland are notorious for their feet and the cheesy
smell they exude.  Some say that it is the Swiss feet that give the
cheese its uniquely rich aroma and flavor, or maybe it is the other
way around...
Interestingly enough, while visiting the US on vacation, a waitress
asked us what kind of cheese we wanted in our sandwich. She listed
the various sorts and we stopped her as soon as she pronounced the words
Swiss cheese. We enthusiastically repeated Swiss cheese with a
twinkle in our eyes, yearning for the Gruyere or possibly the Vacherin
fribourgeois that we enjoy so much.  Talk about a cultural shock when
we realized that Swiss cheese in the US means a gooey slice of
plastic with holes in it. To be fair, it loosely resembled the
Emmental but that is probably stretching the word loosely.
Anyway, we loved every minute of our visit, although there were a few
rare exceptions which are better kept unshared.
If you are wondering if I've lost a marble or two during my stay in
London, I've been sick since my return. And the Apache rules
specifically state** everyone is allowed to go on a tangent once in a
decade. It's my turn. :-)
** If you don't believe me, read the ASF bylaws. It's around section
43 or thereabouts.
--
Ceki  For log4j documentation consider The complete log4j manual
  ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp 

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


Re: tomcat and log4j, again

2003-07-03 Thread Ceki Gülcü
My suggestion would be to start tomcat and set the log4j.debug property to 
true.

The extra command line argument is   -Dlog4j.debug=true

This should show which configuration file log4j load if it loads one at 
all. If your config file is found, you should also see log4j parsing it. 
BTW, your config file looks OK.

At 04:56 PM 7/3/2003 -0400, Dean A. Hoover wrote:
Sorry about that. It turns out that I had
some tags in the web.xml file in the wrong
place. I didn't realize that the order of
those tags was important. Anyway. I fixed
that, but the file logging is still not
working. Here is the catalina.out file:
0 [main] INFO modeler.Registry  - Loading registry information
2 [main] INFO modeler.Registry  - Creating new Registry instance
471 [main] INFO modeler.Registry  - Creating MBeanServer
1214 [main] INFO http11.Http11Protocol  - Initializing Coyote HTTP/1.1 on 
port 8
080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.24
5324 [main] INFO http11.Http11Protocol  - Starting Coyote HTTP/1.1 on port 
8080
5438 [main] INFO common.ChannelSocket  - JK2: ajp13 listening on /0.0.0.0:8009
5440 [main] INFO server.JkMain  - Jk running ID=0 time=1/116 
config=/usr/java/j
akarta-tomcat-4.1.24/conf/jk2.properties
33445 [Thread-5] WARN common.Vendor  - attempt to authenticate 'xxx' failed

So, now there are no exceptions being thrown, but my log message
is still going to catalina.out, despite the properties file:
log4j.logger.fermataintl.migrasponder=DEBUG, l1
log4j.appender.l1=org.apache.log4j.FileAppender
log4j.appender.l1.File=/tmp/migrasponder
log4j.appender.l1.layout=org.apache.log4j.PatternLayout
log4j.appender.l1.layout.ConversionPattern=%d{-MM-dd HH:mm:ss} %-5p 
%F:%L - %m%n

Thanks for all your help. Do you see anything wrong with this?

Dean



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Ceki  For log4j documentation consider The complete log4j manual
  ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp 

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


Re: tomcat and log4j, again

2003-07-03 Thread Dean A. Hoover
Ceki Gülcü wrote:

My suggestion would be to start tomcat and set the log4j.debug 
property to true. 
OK, did it:

log4j.debug=true
log4j.logger.fermataintl.migrasponder=DEBUG, l1
log4j.appender.l1=org.apache.log4j.FileAppender
log4j.appender.l1.File=/tmp/migrasponder
log4j.appender.l1.layout=org.apache.log4j.PatternLayout
log4j.appender.l1.layout.ConversionPattern=%d{-MM-dd HH:mm:ss} %-5p 
%F:%L - %m%n



The extra command line argument is   -Dlog4j.debug=true 
Did that too:

[EMAIL PROTECTED] jakarta-tomcat-4.1.24]# CATALINA_OPTS=-Dlog4j.debug=true
[EMAIL PROTECTED] jakarta-tomcat-4.1.24]# export CATALINA_OPTS
[EMAIL PROTECTED] jakarta-tomcat-4.1.24]# rm logs/catalina.out
rm: remove regular file `logs/catalina.out'? y
[EMAIL PROTECTED] jakarta-tomcat-4.1.24]# bin/startup.sh
Using CATALINA_BASE:   /usr/java/jakarta-tomcat-4.1.24
Using CATALINA_HOME:   /usr/java/jakarta-tomcat-4.1.24
Using CATALINA_TMPDIR: /usr/java/jakarta-tomcat-4.1.24/temp
Using JAVA_HOME:   /usr/java/j2sdk1.4.1_02
I am using ant to build a war file for my app and deploy it to tomcat. I did
a find to locate where tomcat put my log4j.properties file. It put it in:
$CATALINA_HOME/work/Standalone/localhost/vendor/WEB-INF/classes/log4j.properties

The catalina.out file is a bit too long to just cut and paste easily, so 
I am
attaching the file to this email message. It appears to not be able to find
the log4j.properties file and throws an exception. Any more suggestions
will be appreciated.

Thanks.
Dean


This should show which configuration file log4j load if it loads one 
at all. If your config file is found, you should also see log4j 
parsing it. BTW, your config file looks OK.

At 04:56 PM 7/3/2003 -0400, Dean A. Hoover wrote:

Sorry about that. It turns out that I had
some tags in the web.xml file in the wrong
place. I didn't realize that the order of
those tags was important. Anyway. I fixed
that, but the file logging is still not
working. Here is the catalina.out file:
0 [main] INFO modeler.Registry  - Loading registry information
2 [main] INFO modeler.Registry  - Creating new Registry instance
471 [main] INFO modeler.Registry  - Creating MBeanServer
1214 [main] INFO http11.Http11Protocol  - Initializing Coyote 
HTTP/1.1 on port 8
080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.24
5324 [main] INFO http11.Http11Protocol  - Starting Coyote HTTP/1.1 on 
port 8080
5438 [main] INFO common.ChannelSocket  - JK2: ajp13 listening on 
/0.0.0.0:8009
5440 [main] INFO server.JkMain  - Jk running ID=0 time=1/116 
config=/usr/java/j
akarta-tomcat-4.1.24/conf/jk2.properties
33445 [Thread-5] WARN common.Vendor  - attempt to authenticate 'xxx' 
failed

So, now there are no exceptions being thrown, but my log message
is still going to catalina.out, despite the properties file:
log4j.logger.fermataintl.migrasponder=DEBUG, l1
log4j.appender.l1=org.apache.log4j.FileAppender
log4j.appender.l1.File=/tmp/migrasponder
log4j.appender.l1.layout=org.apache.log4j.PatternLayout
log4j.appender.l1.layout.ConversionPattern=%d{-MM-dd HH:mm:ss} 
%-5p %F:%L - %m%n

Thanks for all your help. Do you see anything wrong with this?

Dean



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Ceki  For log4j documentation consider The complete log4j manual
  ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


log4j: Trying to find [log4j.xml] using context classloader StandardClassLoader
  available:
Extension[org.apache.commons.logging, implementationVendor=Apache Software 
Foundation, implementationVersion=1.0.2, specificationVendor=Apache Software 
Foundation, specificationVersion=1.0]
Extension[org.apache.commons.digester, implementationVendor=Apache Software 
Foundation, implementationVersion=1.4.1, specificationVendor=Apache Software 
Foundation, specificationVersion=1.4]
Extension[modeler, implementationVendor=Apache Software Foundation, 
implementationVersion=1.0, specificationVendor=Apache Software Foundation, 
specificationVersion=1.0]
[EMAIL PROTECTED]@, implementationVendor=Apache Software Foundation, [EMAIL 
PROTECTED]@, specificationVendor=Apache Software Foundation, specificationVersion=1.0]
Extension[org.apache.commons.beanutils, implementationVendor=Apache Software 
Foundation, implementationVersion=1.6, specificationVendor=Apache Software Foundation, 
specificationVersion=1.6]
Extension[coyote, implementationVendor=Apache Software Foundation, 
implementationVersion=1.0-dev, specificationVendor=Apache Software Foundation, 
specificationVersion=1.0]
  delegate: true
  repositories:
file:/usr/java/jakarta-tomcat-4.1.24/server/classes/
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/mx4j-jmx.jar

RE: tomcat and log4j, again

2003-07-03 Thread Paul Smith
Mmmm, for some reason it is using all the right class loaders to attempt to
find the log4j.xml file, but it only uses 1 different methods to try to find
log4j.properties.  That is odd.  Is this a Tomcat 4.1 specific class loader
issue?

What about trying converting your log4j.properties file into a log4j.xml
file, and placing it in the same spot.  Given the catalina.out is attempting
to look for that file in the right spots it should find it.

Paul

 -Original Message-
 From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
 Sent: Friday, 4 July 2003 8:37 AM
 To: Log4J Users List
 Subject: Re: tomcat and log4j, again
 
 
 Ceki Gülcü wrote:
 
 
  My suggestion would be to start tomcat and set the log4j.debug 
  property to true. 
 
 OK, did it:
 
 log4j.debug=true
 log4j.logger.fermataintl.migrasponder=DEBUG, l1
 log4j.appender.l1=org.apache.log4j.FileAppender
 log4j.appender.l1.File=/tmp/migrasponder
 log4j.appender.l1.layout=org.apache.log4j.PatternLayout
 log4j.appender.l1.layout.ConversionPattern=%d{-MM-dd 
 HH:mm:ss} %-5p 
 %F:%L - %m%n
 
 
 
  The extra command line argument is   -Dlog4j.debug=true 
 
 Did that too:
 
 [EMAIL PROTECTED] jakarta-tomcat-4.1.24]# 
 CATALINA_OPTS=-Dlog4j.debug=true
 [EMAIL PROTECTED] jakarta-tomcat-4.1.24]# export CATALINA_OPTS
 [EMAIL PROTECTED] jakarta-tomcat-4.1.24]# rm logs/catalina.out
 rm: remove regular file `logs/catalina.out'? y
 [EMAIL PROTECTED] jakarta-tomcat-4.1.24]# bin/startup.sh
 Using CATALINA_BASE:   /usr/java/jakarta-tomcat-4.1.24
 Using CATALINA_HOME:   /usr/java/jakarta-tomcat-4.1.24
 Using CATALINA_TMPDIR: /usr/java/jakarta-tomcat-4.1.24/temp
 Using JAVA_HOME:   /usr/java/j2sdk1.4.1_02
 
 I am using ant to build a war file for my app and deploy it 
 to tomcat. I did
 a find to locate where tomcat put my log4j.properties file. 
 It put it in:
 
 $CATALINA_HOME/work/Standalone/localhost/vendor/WEB-INF/classe
 s/log4j.properties
 
 The catalina.out file is a bit too long to just cut and paste 
 easily, so 
 I am
 attaching the file to this email message. It appears to not 
 be able to find
 the log4j.properties file and throws an exception. Any more 
 suggestions
 will be appreciated.
 
 Thanks.
 Dean
 
 
 
  This should show which configuration file log4j load if it 
 loads one 
  at all. If your config file is found, you should also see log4j 
  parsing it. BTW, your config file looks OK.
 
  At 04:56 PM 7/3/2003 -0400, Dean A. Hoover wrote:
 
  Sorry about that. It turns out that I had
  some tags in the web.xml file in the wrong
  place. I didn't realize that the order of
  those tags was important. Anyway. I fixed
  that, but the file logging is still not
  working. Here is the catalina.out file:
 
  0 [main] INFO modeler.Registry  - Loading registry information
  2 [main] INFO modeler.Registry  - Creating new Registry instance
  471 [main] INFO modeler.Registry  - Creating MBeanServer
  1214 [main] INFO http11.Http11Protocol  - Initializing Coyote 
  HTTP/1.1 on port 8
  080
  Starting service Tomcat-Standalone
  Apache Tomcat/4.1.24
  5324 [main] INFO http11.Http11Protocol  - Starting Coyote 
 HTTP/1.1 on 
  port 8080
  5438 [main] INFO common.ChannelSocket  - JK2: ajp13 listening on 
  /0.0.0.0:8009
  5440 [main] INFO server.JkMain  - Jk running ID=0 time=1/116 
  config=/usr/java/j
  akarta-tomcat-4.1.24/conf/jk2.properties
  33445 [Thread-5] WARN common.Vendor  - attempt to 
 authenticate 'xxx' 
  failed
 
  So, now there are no exceptions being thrown, but my log message
  is still going to catalina.out, despite the properties file:
 
  log4j.logger.fermataintl.migrasponder=DEBUG, l1
  log4j.appender.l1=org.apache.log4j.FileAppender
  log4j.appender.l1.File=/tmp/migrasponder
  log4j.appender.l1.layout=org.apache.log4j.PatternLayout
  log4j.appender.l1.layout.ConversionPattern=%d{-MM-dd HH:mm:ss} 
  %-5p %F:%L - %m%n
 
  Thanks for all your help. Do you see anything wrong with this?
 
  Dean
 
 
 
 
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -- 
  Ceki  For log4j documentation consider The complete log4j manual
ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp
 
  
 -
  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, again

2003-07-03 Thread Ceki Gülcü
At 08:40 AM 7/4/2003 +1000, you wrote:
Mmmm, for some reason it is using all the right class loaders to attempt to
find the log4j.xml file, but it only uses 1 different methods to try to find
log4j.properties.  That is odd.  Is this a Tomcat 4.1 specific class loader
issue?
That's probably a cut-n-paste issue. Log4j searches for the log4j.xml file 
first, but otherwise it searches in the same way as for the 
log4j.properties file.

What about trying converting your log4j.properties file into a log4j.xml
file, and placing it in the same spot.  Given the catalina.out is attempting
to look for that file in the right spots it should find it.
Using log4j.properties is fine. No need to convert to log4j.xml on account 
of initialization.

Paul
--
Ceki  For log4j documentation consider The complete log4j manual
  ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp 

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


Re: tomcat and log4j, again

2003-07-03 Thread Ceki Gülcü
Do you have a copy of the log4j.jar file other than the WEB_INF/lib 
directory of your web-app?

Do you have it in the classpath? In the JVM extensions directory?

By the way, tomcat is not starting properly which means that your web-app 
will also not start but you get log4j messages which mean that there is a 
copy of log4j.jar in a place other than your web-app's WEB_INF/lib directory.

log4j: Trying to find [log4j.xml] using context classloader 
StandardClassLoader
  available:
Extension[org.apache.commons.logging, implementationVendor=Apache 
Software Foundation, implementationVersion=1.0.2, 
specificationVendor=Apache Software Foundation, specificationVersion=1.0]
Extension[org.apache.commons.digester, implementationVendor=Apache 
Software Foundation, implementationVersion=1.4.1, 
specificationVendor=Apache Software Foundation, specificationVersion=1.4]
Extension[modeler, implementationVendor=Apache Software Foundation, 
implementationVersion=1.0, specificationVendor=Apache Software 
Foundation, specificationVersion=1.0]
[EMAIL PROTECTED]@, implementationVendor=Apache Software Foundation, 
[EMAIL PROTECTED]@, specificationVendor=Apache Software 
Foundation, specificationVersion=1.0]
Extension[org.apache.commons.beanutils, implementationVendor=Apache 
Software Foundation, implementationVersion=1.6, 
specificationVendor=Apache Software Foundation, specificationVersion=1.6]
Extension[coyote, implementationVendor=Apache Software Foundation, 
implementationVersion=1.0-dev, specificationVendor=Apache Software 
Foundation, specificationVersion=1.0]
  delegate: true
  repositories:
file:/usr/java/jakarta-tomcat-4.1.24/server/classes/
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/mx4j-jmx.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-logging.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-digester.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/servlets-invoker.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/servlets-manager.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-modeler.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/servlets-default.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-http11.jar

file:/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-fileupload-1.0-beta-1.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-util.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/catalina.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-beanutils.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-coyote.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/jaas.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/servlets-common.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/servlets-webdav.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-warp.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/catalina-ant.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-jk2.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/jakarta-regexp-1.2.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-jk.jar
  required:
-- Parent Classloader:
StandardClassLoader
  available:
Extension[javax.mail, implementationVendor=Sun Microsystems, Inc., 
implementationVendorId=com.sun, implementationVersion=1.2, 
specificationVendor=Sun Microsystems, Inc., specificationVersion=1.2]
Extension[org.apache.commons.logging, implementationVendor=Apache 
Software Foundation, implementationVersion=1.0.2, 
specificationVendor=Apache Software Foundation, specificationVersion=1.0]
Extension[org.apache.commons.collections, implementationVendor=Apache 
Software Foundation, implementationVersion=2.1, 
specificationVendor=Apache Software Foundation, specificationVersion=2.1]
Extension[org.apache.commons.pool, implementationVendor=Apache 
Software Foundation, implementationVersion=1.0.1, 
specificationVendor=Apache Software Foundation, specificationVersion=1.0]
Extension[org.apache.commons.dbcp, implementationVendor=Apache 
Software Foundation, implementationVersion=1.0, 
specificationVendor=Apache Software Foundation, specificationVersion=1.0]
Extension[org.apache.tools.ant, implementationVendor=Apache Software 
Foundation, implementationVersion=1.5.1, specificationVendor=Apache 
Software Foundation, specificationVersion=1.5.1]
  delegate: true
  repositories:
file:/usr/java/jakarta-tomcat-4.1.24/common/classes/
file:/usr/java/jakarta-tomcat-4.1.24/common/endorsed/xercesImpl.jar
file:/usr/java/jakarta-tomcat-4.1.24/common/endorsed/xmlParserAPIs.jar
file:/usr/java/jakarta-tomcat-4.1.24/common/lib/servlet.jar
file:/usr/java/jakarta-tomcat-4.1.24/common/lib/mail.jar
file:/usr/java/jakarta-tomcat-4.1.24/common/lib/commons-logging-api.jar
file:/usr/java/jakarta-tomcat-4.1.24/common/lib/commons-collections.jar

Re: tomcat and log4j, again

2003-07-03 Thread Dean A. Hoover
Ceki Gülcü wrote:

At 08:40 AM 7/4/2003 +1000, you wrote:

Mmmm, for some reason it is using all the right class loaders to 
attempt to
find the log4j.xml file, but it only uses 1 different methods to try 
to find
log4j.properties.  That is odd.  Is this a Tomcat 4.1 specific class 
loader
issue?


That's probably a cut-n-paste issue. Log4j searches for the log4j.xml 
file first, but otherwise it searches in the same way as for the 
log4j.properties file. 
Not a cut-n-paste issue. I blew away the catalina.out file prior to 
startup.sh. I then
attached the entire file, since it was more than a screenful for cutting and
pasting. What you see is what I got.



What about trying converting your log4j.properties file into a log4j.xml
file, and placing it in the same spot.  Given the catalina.out is 
attempting
to look for that file in the right spots it should find it.


Using log4j.properties is fine. No need to convert to log4j.xml on 
account of initialization.

Paul


--
Ceki  For log4j documentation consider The complete log4j manual
  ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp
-
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, again

2003-07-03 Thread Dean A. Hoover
Ceki Gülcü wrote:

Do you have a copy of the log4j.jar file other than the WEB_INF/lib 
directory of your web-app? 
I did a find on *log*.jar and found the following:

/usr/java/j2sdk1.4.1_02/jre/lib/ext/log4j-1.2.8.jar
/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-logging.jar
/usr/java/jakarta-tomcat-4.1.24/common/lib/commons-logging-api.jar
/usr/java/jakarta-tomcat-4.1.24/work/Standalone/localhost/vendor/WEB-INF/lib/log4j-1.2.8.jar
/usr/java/apache-ant-1.6alpha/lib/ant-weblogic.jar
/usr/java/apache-ant-1.6alpha/lib/ant-commons-logging.jar
/usr/java/apache-ant-1.6alpha/lib/ant-log4j.jar
I believe I put the first one in there myself. Will that cause a problem?



Do you have it in the classpath? In the JVM extensions directory?

By the way, tomcat is not starting properly which means that your 
web-app will also not start but you get log4j messages which mean that 
there is a copy of log4j.jar in a place other than your web-app's 
WEB_INF/lib directory.

log4j: Trying to find [log4j.xml] using context classloader 
StandardClassLoader
  available:
Extension[org.apache.commons.logging, implementationVendor=Apache 
Software Foundation, implementationVersion=1.0.2, 
specificationVendor=Apache Software Foundation, 
specificationVersion=1.0]
Extension[org.apache.commons.digester, 
implementationVendor=Apache Software Foundation, 
implementationVersion=1.4.1, specificationVendor=Apache Software 
Foundation, specificationVersion=1.4]
Extension[modeler, implementationVendor=Apache Software 
Foundation, implementationVersion=1.0, specificationVendor=Apache 
Software Foundation, specificationVersion=1.0]
[EMAIL PROTECTED]@, implementationVendor=Apache Software 
Foundation, [EMAIL PROTECTED]@, 
specificationVendor=Apache Software Foundation, 
specificationVersion=1.0]
Extension[org.apache.commons.beanutils, 
implementationVendor=Apache Software Foundation, 
implementationVersion=1.6, specificationVendor=Apache Software 
Foundation, specificationVersion=1.6]
Extension[coyote, implementationVendor=Apache Software 
Foundation, implementationVersion=1.0-dev, specificationVendor=Apache 
Software Foundation, specificationVersion=1.0]
  delegate: true
  repositories:
file:/usr/java/jakarta-tomcat-4.1.24/server/classes/
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/mx4j-jmx.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-logging.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-digester.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/servlets-invoker.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/servlets-manager.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-modeler.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/servlets-default.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-http11.jar

file:/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-fileupload-1.0-beta-1.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-util.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/catalina.jar

file:/usr/java/jakarta-tomcat-4.1.24/server/lib/commons-beanutils.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-coyote.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/jaas.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/servlets-common.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/servlets-webdav.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-warp.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/catalina-ant.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-jk2.jar

file:/usr/java/jakarta-tomcat-4.1.24/server/lib/jakarta-regexp-1.2.jar
file:/usr/java/jakarta-tomcat-4.1.24/server/lib/tomcat-jk.jar
  required:
-- Parent Classloader:
StandardClassLoader
  available:
Extension[javax.mail, implementationVendor=Sun Microsystems, 
Inc., implementationVendorId=com.sun, implementationVersion=1.2, 
specificationVendor=Sun Microsystems, Inc., specificationVersion=1.2]
Extension[org.apache.commons.logging, implementationVendor=Apache 
Software Foundation, implementationVersion=1.0.2, 
specificationVendor=Apache Software Foundation, 
specificationVersion=1.0]
Extension[org.apache.commons.collections, 
implementationVendor=Apache Software Foundation, 
implementationVersion=2.1, specificationVendor=Apache Software 
Foundation, specificationVersion=2.1]
Extension[org.apache.commons.pool, implementationVendor=Apache 
Software Foundation, implementationVersion=1.0.1, 
specificationVendor=Apache Software Foundation, 
specificationVersion=1.0]
Extension[org.apache.commons.dbcp, implementationVendor=Apache 
Software Foundation, implementationVersion=1.0, 
specificationVendor=Apache Software Foundation, 
specificationVersion=1.0]
Extension[org.apache.tools.ant, implementationVendor=Apache 
Software Foundation, implementationVersion=1.5.1, 
specificationVendor=Apache Software Foundation, 

RE: TOMCAT and LOG4J

2002-10-21 Thread Ceki Gülcü
At 10:46 21.10.2002 +0200, you wrote:


Hi all:

I'm using Tomcat, log4j and org.apache.xml.security library.

I use a log4j.properties file to config the logging features.

It works fine until I iniritialize the org.apache.xml.security library. It 
seems that this library has a NullApender that it is initialized.

The log of log4j is the next:

(Reading the config from log4j.properties...)
log4j: Level token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named file.
log4j: Parsing layout options for file.
log4j: Setting property [conversionPattern] to [%-4r [%t] %-5p %c %x - %m%n].
log4j: End of parsing for file.
log4j: Setting property [file] to [/home/eceejcr/LIB-PHASE1/IDP/IDP.log].
log4j: setFile called: /home/eceejcr/LIB-PHASE1/IDP/IDP.log, true
log4j: setFile ended
log4j: Parsed file options.
log4j: Parsing for [org.apache.xml.security] with value=[OFF].
log4j: Level token is [OFF].
log4j: Category org.apache.xml.security set to OFF
log4j: Handling log4j.additivity.org.apache.xml.security=[null]
log4j: Finished configuring.

But later...
log4j: debug attribute= .
log4j: Ignoring debug attribute.
log4j: Threshold =.
log4j: Level value for root is  [fatal].
log4j: root level set to FATAL
log4j: Class name: [org.apache.xml.security.utils.NullAppender]
log4j: Adding appender named [NULL] to category [root].
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.log4j.xml] additivity to [true].
log4j: Level value for org.apache.log4j.xml is  [info].
log4j: org.apache.log4j.xml level set to INFO
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.xml.security] additivity to [true].
log4j: Level value for org.apache.xml.security is  [fatal].
log4j: org.apache.xml.security level set to FATAL
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.xml.security.test.AllTests] additivity to [true].
log4j: Level value for org.apache.xml.security.test.AllTests is  [debug].
log4j: org.apache.xml.security.test.AllTests level set to DEBUG

And stops working properly...

Well, it seems that someone sets the root logger to FATAL and adding a 
NullAppender to root. Log4j is doing what it is supposed to do. Talk to the 
org.apache.xml.security people or whoever is doing it. It looks like the 
xml.security guys are hosing up the log4j configuration on purpose.

I'm blocked...

Regards,

Evaristo


--
Ceki

TCP implementations will follow a general principle of robustness: be
conservative in what you do, be liberal in what you accept from
others. -- Jon Postel, RFC 793



--
To unsubscribe, e-mail:   mailto:log4j-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:log4j-user-help;jakarta.apache.org




RE: TOMCAT and LOG4J

2002-10-21 Thread Evaristo-Jose Camarero (ECE)

Hi all:

I'm using Tomcat, log4j and org.apache.xml.security library.

I use a log4j.properties file to config the logging features.

It works fine until I iniritialize the org.apache.xml.security library. It seems that 
this library has a NullApender that it is initialized.

The log of log4j is the next:

(Reading the config from log4j.properties...)
log4j: Level token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named file.
log4j: Parsing layout options for file.
log4j: Setting property [conversionPattern] to [%-4r [%t] %-5p %c %x - %m%n].
log4j: End of parsing for file.
log4j: Setting property [file] to [/home/eceejcr/LIB-PHASE1/IDP/IDP.log].
log4j: setFile called: /home/eceejcr/LIB-PHASE1/IDP/IDP.log, true
log4j: setFile ended
log4j: Parsed file options.
log4j: Parsing for [org.apache.xml.security] with value=[OFF].
log4j: Level token is [OFF].
log4j: Category org.apache.xml.security set to OFF
log4j: Handling log4j.additivity.org.apache.xml.security=[null]
log4j: Finished configuring.

But later...
log4j: debug attribute= .
log4j: Ignoring debug attribute.
log4j: Threshold =.
log4j: Level value for root is  [fatal].
log4j: root level set to FATAL
log4j: Class name: [org.apache.xml.security.utils.NullAppender]
log4j: Adding appender named [NULL] to category [root].
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.log4j.xml] additivity to [true].
log4j: Level value for org.apache.log4j.xml is  [info].
log4j: org.apache.log4j.xml level set to INFO
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.xml.security] additivity to [true].
log4j: Level value for org.apache.xml.security is  [fatal].
log4j: org.apache.xml.security level set to FATAL
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.xml.security.test.AllTests] additivity to [true].
log4j: Level value for org.apache.xml.security.test.AllTests is  [debug].
log4j: org.apache.xml.security.test.AllTests level set to DEBUG

And stops working properly...

I'm blocked...

Regards,

Evaristo

 -Original Message-
 From: Evaristo-Jose Camarero (ECE)
 [mailto:Evaristo-Jose.Camarero;ece.ericsson.se]
 Sent: Friday, October 18, 2002 1:55 PM
 To: 'Log4J Users List'
 Subject: RE: TOMCAT and LOG4J
 
 
 
 Hi all:
 
 It seems that problem is related with use between Log4j and 
 org.apache.xml.security.
 
 When I initialize the security library something happens, and 
 the logger stops function properly. It seems that a 
 NullApender from security class is added destroying all the 
 configuration of log4j.properties.
 
 Any clue?
 
 Regards,
 
 Evaristo
 
  -Original Message-
  From: sunita desai [mailto:sudesai;cisco.com]
  Sent: Friday, October 18, 2002 10:16 AM
  To: Log4J Users List
  Subject: RE: TOMCAT and LOG4J
  
  
  HI,
  
  SOrry I did not try your earlier mail properly.
  
  YEs you need the put the log4j jar in the lib directory as 
  mentioned by you.
  Tomcat does not have this jar file.
  
  Regards,
  Sunita
  
  -Original Message-
  From: Evaristo-Jose Camarero (ECE)
  [mailto:Evaristo-Jose.Camarero;ece.ericsson.se]
  Sent: Friday, October 18, 2002 1:37 PM
  To: 'Log4J Users List'
  Subject: RE: TOMCAT and LOG4J
  
  
  
  Hi Sunita and all:
  
  I have tried it but it doesn't work.
  
  What I see, is that the log file is created, but no log is 
  put inside...
  
  It could be related with this:
  Is it needed to put the log4j_1.2.5.jar in WEB-INF/lib/ in
  the webapp or I can assume that Tomcat supplies that library?
  
  Thanks and regards,
  
  Evaristo
  
   -Original Message-
   From: sunita desai [mailto:sudesai;cisco.com]
   Sent: Friday, October 18, 2002 9:44 AM
   To: Log4J Users List
   Subject: RE: TOMCAT and LOG4J
  
  
   Hi,
  
   Try adding the layout and ConversionPAttern something like 
  like below
   to your properties file.
  
   Rgds,
   Sunita
  
   log4j.appender.A1.layout=org.apache.log4j.PatternLayout
   log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p 
  %c %x - %m%n
  
   -Original Message-
   From: Evaristo-Jose Camarero (ECE)
   [mailto:Evaristo-Jose.Camarero;ece.ericsson.se]
   Sent: Friday, October 18, 2002 1:07 PM
   To: '[EMAIL PROTECTED]'
   Subject: TOMCAT and LOG4J
  
  
  
   Hi all:
  
   I'm using tomcat 4.1.12 and log4j_1.2.5 library. Java
   1.3.1_05 and RedHAt
   7.1
   I am trying to configure my webapp to log to a files, but I'm
   not able to do
   it...
  
   I have some questions:
  
   Is it needed to put the log4j_1.2.5.jar in WEB-INF/lib/ in
   the webapp or I
   can assume that Tomcat supplies that library?
  
   I put log4j.properties file in WEB-INF/classes/ in my web 
  application.
  
   When I start the application the file for logging is created
   but later is
   empty...
  
   I send you my log4j.properties.
  
log4j.properties
  
   Thank you very much,
  
 Evaristo José Camarero del Río
 Systems

RE: TOMCAT and LOG4J

2002-10-18 Thread Evaristo-Jose Camarero (ECE)

Hi Sunita and all:

I have tried it but it doesn't work.

What I see, is that the log file is created, but no log is put inside...

It could be related with this:
Is it needed to put the log4j_1.2.5.jar in WEB-INF/lib/ in 
the webapp or I can assume that Tomcat supplies that library?

Thanks and regards,

Evaristo

 -Original Message-
 From: sunita desai [mailto:sudesai;cisco.com]
 Sent: Friday, October 18, 2002 9:44 AM
 To: Log4J Users List
 Subject: RE: TOMCAT and LOG4J
 
 
 Hi,
 
 Try adding the layout and ConversionPAttern something like like below
 to your properties file.
 
 Rgds,
 Sunita
 
 log4j.appender.A1.layout=org.apache.log4j.PatternLayout
 log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
 
 -Original Message-
 From: Evaristo-Jose Camarero (ECE)
 [mailto:Evaristo-Jose.Camarero;ece.ericsson.se]
 Sent: Friday, October 18, 2002 1:07 PM
 To: '[EMAIL PROTECTED]'
 Subject: TOMCAT and LOG4J
 
 
 
 Hi all:
 
 I'm using tomcat 4.1.12 and log4j_1.2.5 library. Java 
 1.3.1_05 and RedHAt
 7.1
 I am trying to configure my webapp to log to a files, but I'm 
 not able to do
 it...
 
 I have some questions:
 
 Is it needed to put the log4j_1.2.5.jar in WEB-INF/lib/ in 
 the webapp or I
 can assume that Tomcat supplies that library?
 
 I put log4j.properties file in WEB-INF/classes/ in my web application.
 
 When I start the application the file for logging is created 
 but later is
 empty...
 
 I send you my log4j.properties.
 
  log4j.properties
 
 Thank you very much,
 
   Evaristo José Camarero del Río
   Systems Engineer
   UMTS/GSM Systems Management
 
  Ericsson España, S.A.   Phone:  +34 91 339 4200
  Ombú, 3 Fax:+34 91 339 2538
  28045 Madrid, Spain E-mail: 
 [EMAIL PROTECTED]
 
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:log4j-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:log4j-user-help;jakarta.apache.org
 

--
To unsubscribe, e-mail:   mailto:log4j-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:log4j-user-help;jakarta.apache.org




RE: TOMCAT and LOG4J

2002-10-18 Thread sunita desai
HI,

SOrry I did not try your earlier mail properly.

YEs you need the put the log4j jar in the lib directory as mentioned by you.
Tomcat does not have this jar file.

Regards,
Sunita

-Original Message-
From: Evaristo-Jose Camarero (ECE)
[mailto:Evaristo-Jose.Camarero;ece.ericsson.se]
Sent: Friday, October 18, 2002 1:37 PM
To: 'Log4J Users List'
Subject: RE: TOMCAT and LOG4J



Hi Sunita and all:

I have tried it but it doesn't work.

What I see, is that the log file is created, but no log is put inside...

It could be related with this:
Is it needed to put the log4j_1.2.5.jar in WEB-INF/lib/ in
the webapp or I can assume that Tomcat supplies that library?

Thanks and regards,

Evaristo

 -Original Message-
 From: sunita desai [mailto:sudesai;cisco.com]
 Sent: Friday, October 18, 2002 9:44 AM
 To: Log4J Users List
 Subject: RE: TOMCAT and LOG4J


 Hi,

 Try adding the layout and ConversionPAttern something like like below
 to your properties file.

 Rgds,
 Sunita

 log4j.appender.A1.layout=org.apache.log4j.PatternLayout
 log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

 -Original Message-
 From: Evaristo-Jose Camarero (ECE)
 [mailto:Evaristo-Jose.Camarero;ece.ericsson.se]
 Sent: Friday, October 18, 2002 1:07 PM
 To: '[EMAIL PROTECTED]'
 Subject: TOMCAT and LOG4J



 Hi all:

 I'm using tomcat 4.1.12 and log4j_1.2.5 library. Java
 1.3.1_05 and RedHAt
 7.1
 I am trying to configure my webapp to log to a files, but I'm
 not able to do
 it...

 I have some questions:

 Is it needed to put the log4j_1.2.5.jar in WEB-INF/lib/ in
 the webapp or I
 can assume that Tomcat supplies that library?

 I put log4j.properties file in WEB-INF/classes/ in my web application.

 When I start the application the file for logging is created
 but later is
 empty...

 I send you my log4j.properties.

  log4j.properties

 Thank you very much,

   Evaristo José Camarero del Río
   Systems Engineer
   UMTS/GSM Systems Management

  Ericsson España, S.A.   Phone:  +34 91 339 4200
  Ombú, 3 Fax:+34 91 339 2538
  28045 Madrid, Spain E-mail:
 [EMAIL PROTECTED]
 
 


 --
 To unsubscribe, e-mail:
 mailto:log4j-user- [EMAIL PROTECTED]
 For
 additional commands,
 e-mail: mailto:log4j-user-help;jakarta.apache.org


--
To unsubscribe, e-mail:   mailto:log4j-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:log4j-user-help;jakarta.apache.org



--
To unsubscribe, e-mail:   mailto:log4j-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:log4j-user-help;jakarta.apache.org




RE: TOMCAT and LOG4J

2002-10-18 Thread Evaristo-Jose Camarero (ECE)

Hi all:

It seems that problem is related with use between Log4j and org.apache.xml.security.

When I initialize the security library something happens, and the logger stops 
function properly. It seems that a NullApender from security class is added destroying 
all the configuration of log4j.properties.

Any clue?

Regards,

Evaristo

 -Original Message-
 From: sunita desai [mailto:sudesai;cisco.com]
 Sent: Friday, October 18, 2002 10:16 AM
 To: Log4J Users List
 Subject: RE: TOMCAT and LOG4J
 
 
 HI,
 
 SOrry I did not try your earlier mail properly.
 
 YEs you need the put the log4j jar in the lib directory as 
 mentioned by you.
 Tomcat does not have this jar file.
 
 Regards,
 Sunita
 
 -Original Message-
 From: Evaristo-Jose Camarero (ECE)
 [mailto:Evaristo-Jose.Camarero;ece.ericsson.se]
 Sent: Friday, October 18, 2002 1:37 PM
 To: 'Log4J Users List'
 Subject: RE: TOMCAT and LOG4J
 
 
 
 Hi Sunita and all:
 
 I have tried it but it doesn't work.
 
 What I see, is that the log file is created, but no log is 
 put inside...
 
 It could be related with this:
 Is it needed to put the log4j_1.2.5.jar in WEB-INF/lib/ in
 the webapp or I can assume that Tomcat supplies that library?
 
 Thanks and regards,
 
 Evaristo
 
  -Original Message-
  From: sunita desai [mailto:sudesai;cisco.com]
  Sent: Friday, October 18, 2002 9:44 AM
  To: Log4J Users List
  Subject: RE: TOMCAT and LOG4J
 
 
  Hi,
 
  Try adding the layout and ConversionPAttern something like 
 like below
  to your properties file.
 
  Rgds,
  Sunita
 
  log4j.appender.A1.layout=org.apache.log4j.PatternLayout
  log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p 
 %c %x - %m%n
 
  -Original Message-
  From: Evaristo-Jose Camarero (ECE)
  [mailto:Evaristo-Jose.Camarero;ece.ericsson.se]
  Sent: Friday, October 18, 2002 1:07 PM
  To: '[EMAIL PROTECTED]'
  Subject: TOMCAT and LOG4J
 
 
 
  Hi all:
 
  I'm using tomcat 4.1.12 and log4j_1.2.5 library. Java
  1.3.1_05 and RedHAt
  7.1
  I am trying to configure my webapp to log to a files, but I'm
  not able to do
  it...
 
  I have some questions:
 
  Is it needed to put the log4j_1.2.5.jar in WEB-INF/lib/ in
  the webapp or I
  can assume that Tomcat supplies that library?
 
  I put log4j.properties file in WEB-INF/classes/ in my web 
 application.
 
  When I start the application the file for logging is created
  but later is
  empty...
 
  I send you my log4j.properties.
 
   log4j.properties
 
  Thank you very much,
 
  Evaristo José Camarero del Río
  Systems Engineer
  UMTS/GSM Systems Management
 
   Ericsson España, S.A. Phone:  +34 91 339 4200
   Ombú, 3   Fax:+34 91 339 2538
   28045 Madrid, Spain   E-mail:
  [EMAIL PROTECTED]
  
  
 
 
  --
  To unsubscribe, e-mail:
  mailto:log4j-user- [EMAIL PROTECTED]
  For
  additional commands,
  e-mail: mailto:log4j-user-help;jakarta.apache.org
 
 
 --
 To unsubscribe, e-mail:   
 mailto:log4j-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:log4j-user-help;jakarta.apache.org
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:log4j-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:log4j-user-help;jakarta.apache.org
 

--
To unsubscribe, e-mail:   mailto:log4j-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:log4j-user-help;jakarta.apache.org




RE: Tomcat and Log4j

2001-07-24 Thread Carolyn Wasikowski

Set the File property in your property file.  You can use ${tomcat.home}
to refer to the system property set by the Tomcat start-up scripts.  For 
example:

  log4j.appender.LogFile.File=${tomcat.home}/logs/MyApp.log

-JC

[EMAIL PROTECTED]
http://www.roguewave.com


-Original Message-
From: Barbara Baughman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 24, 2001 8:12 AM
To: [EMAIL PROTECTED]
Subject: Tomcat and Log4j


I have the logging working in my application, but I need to know how to
set the login file so it comes under webapps/myapp instead of
TOMCAT_HOME/bin.

I'm sure it has something to do with getServletContext.getRealPath(), but
I don't know where to look for the property after I do
PropertyConfigurator.configure() or what log4j calls the property (file
name of the log file).

Thanks in advance for any help.

Barbara Baughman
X2157


-
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

2001-07-20 Thread altuga

thanks for the answers .. 

if i decide to use only one log4j.properties with tomcat , where can i put
this log4j.properties file
and how can i use logging system in my beans ?   in every bean's method i
have to set like that 


PropertyConfigurator.configure(/usr/local/tomcat/conf/log4j.properties);

??? 


i have confused, because log4j documents  aren't  very clear especially the
tomcat part 
so if anyone can send me simple and short example i will be glad .. 

-Original Message-
From: William Jaynes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 19, 2001 10:08 PM
To: LOG4J Users Mailing List
Subject: Re: tomcat and log4j


If one wishes different web apps to pick up different log4j.properties files
then
1) Do not set anything log4j related in the TOMCAT_OPTS
2) Do not have the log4j.jar anywhere but as specified in step 3.
3) put log4j.jar into each web apps WEB-INF/lib directory
4) put log4j.properties in each web apps WEB-INF/classes directory

With the above configuration the log4j default initialization for each web
app
will find the appropriate log4j.properties.

Will

- Original Message -
From: Ceki Gülcü [EMAIL PROTECTED]
To: LOG4J Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, July 19, 2001 2:43 PM
Subject: Re: tomcat and log4j



That should not be the case. Different webapps should be loaded by different
classloaders resulting in parallel configurations of log4j.

At 16:48 19.07.2001 +0300, you wrote:
Hi all

i have got tomcat and log4j entegration problem ..

first of all i defined   TOMCAT_OPTS =
-Dlog4j.configuration=log4j.properties 
then i put two  log4j.properties under two different contexts  , test ,
bireysel
these log4j.property files are different from each other

content of  log4j.property file under
TOMCAT_HOME/webapps/test/WEB-INF/classes
**
# Set root category priority to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG,Rx


# Rx is set to be a ConsoleAppender.
log4j.appender.Rx=org.apache.log4j.FileAppender
log4j.appender.Rx.File=/tmp/bireysel_heboo.log

# Rx uses PatternLayout.
log4j.appender.Rx.layout=org.apache.log4j.PatternLayout
log4j.appender.Rx.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


content of  log4j.property file under
TOMCAT_HOME/webapps/bireysel/WEB-INF/classes
**
# Set root category priority to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG,R


# R is set to be a ConsoleAppender.
log4j.appender.R=org.apache.log4j.FileAppender
log4j.appender.R.File=/tmp/heboo.log

# R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n




but i encounter that that these two context's log data  are written to the
same log file  /tmp/bireysel_heboo.log
any idea ?

thanks ..










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

--
Ceki Gülcü - http://qos.ch


-
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 and log4j

2001-07-20 Thread Robert Leftwich

At 05:14 PM 20/07/2001, [EMAIL PROTECTED] wrote:
thanks for the answers ..

if i decide to use only one log4j.properties with tomcat , where can i put
this log4j.properties file
and how can i use logging system in my beans ?   in every bean's method i
have to set like that


PropertyConfigurator.configure(/usr/local/tomcat/conf/log4j.properties);

???


i have confused, because log4j documents  aren't  very clear especially the
tomcat part
so if anyone can send me simple and short example i will be glad ..


Have you read the documentation for log4j 1.1.3? In the 'Introductory 
manual' there is a section titled 'Default Initialization under 
Tomcat'  that contains the following :

Example 4
The Windows shell command
set TOMCAT_OPTS=-Dlog4j.configuration=file:/c:/foobar.lcf
tells log4j to use the file c:\foobar.xml as the default configuration 
file. The configuration file is fully specified by the URL 
file:/c:/foobar.lcf. Thus, the same configuration file will be used for all 
web-applications -- in other words, disaster waiting to happen.

Use at your own peril!

Robert


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




Re: tomcat and log4j

2001-07-19 Thread Ceki Gülcü


That should not be the case. Different webapps should be loaded by different 
classloaders resulting in parallel configurations of log4j. 

At 16:48 19.07.2001 +0300, you wrote:
Hi all 

i have got tomcat and log4j entegration problem ..

first of all i defined   TOMCAT_OPTS =
-Dlog4j.configuration=log4j.properties  
then i put two  log4j.properties under two different contexts  , test ,
bireysel 
these log4j.property files are different from each other 

content of  log4j.property file under
TOMCAT_HOME/webapps/test/WEB-INF/classes 
**
# Set root category priority to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG,Rx
  

# Rx is set to be a ConsoleAppender. 
log4j.appender.Rx=org.apache.log4j.FileAppender
log4j.appender.Rx.File=/tmp/bireysel_heboo.log
  
# Rx uses PatternLayout.
log4j.appender.Rx.layout=org.apache.log4j.PatternLayout
log4j.appender.Rx.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


content of  log4j.property file under
TOMCAT_HOME/webapps/bireysel/WEB-INF/classes 
**
# Set root category priority to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG,R
  

# R is set to be a ConsoleAppender. 
log4j.appender.R=org.apache.log4j.FileAppender
log4j.appender.R.File=/tmp/heboo.log 
  
# R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n




but i encounter that that these two context's log data  are written to the
same log file  /tmp/bireysel_heboo.log  
any idea ? 

thanks ..  










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

--
Ceki Gülcü - http://qos.ch


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




Re: tomcat and log4j

2001-07-19 Thread William Jaynes

If one wishes different web apps to pick up different log4j.properties files
then
1) Do not set anything log4j related in the TOMCAT_OPTS
2) Do not have the log4j.jar anywhere but as specified in step 3.
3) put log4j.jar into each web apps WEB-INF/lib directory
4) put log4j.properties in each web apps WEB-INF/classes directory

With the above configuration the log4j default initialization for each web app
will find the appropriate log4j.properties.

Will

- Original Message -
From: Ceki Gülcü [EMAIL PROTECTED]
To: LOG4J Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, July 19, 2001 2:43 PM
Subject: Re: tomcat and log4j



That should not be the case. Different webapps should be loaded by different
classloaders resulting in parallel configurations of log4j.

At 16:48 19.07.2001 +0300, you wrote:
Hi all

i have got tomcat and log4j entegration problem ..

first of all i defined   TOMCAT_OPTS =
-Dlog4j.configuration=log4j.properties 
then i put two  log4j.properties under two different contexts  , test ,
bireysel
these log4j.property files are different from each other

content of  log4j.property file under
TOMCAT_HOME/webapps/test/WEB-INF/classes
**
# Set root category priority to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG,Rx


# Rx is set to be a ConsoleAppender.
log4j.appender.Rx=org.apache.log4j.FileAppender
log4j.appender.Rx.File=/tmp/bireysel_heboo.log

# Rx uses PatternLayout.
log4j.appender.Rx.layout=org.apache.log4j.PatternLayout
log4j.appender.Rx.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


content of  log4j.property file under
TOMCAT_HOME/webapps/bireysel/WEB-INF/classes
**
# Set root category priority to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG,R


# R is set to be a ConsoleAppender.
log4j.appender.R=org.apache.log4j.FileAppender
log4j.appender.R.File=/tmp/heboo.log

# R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n




but i encounter that that these two context's log data  are written to the
same log file  /tmp/bireysel_heboo.log
any idea ?

thanks ..










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

--
Ceki Gülcü - http://qos.ch


-
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

2001-05-07 Thread Dominique JOCAL

Isn't it simply based on the resource loading mechanism ? (i.e. the file
has to be available in a root package in the classpath)

Dominique JOCAL
Consultant - OCTO Technology
mailto:[EMAIL PROTECTED]
tel:+33 6 22 66 09 70
http://www.octo.com
- Original Message -
From: Anuj Agrawal [EMAIL PROTECTED]
To: LOG4J Users Mailing List [EMAIL PROTECTED]
Sent: Monday, May 07, 2001 2:05 PM
Subject: Re: tomcat and log4j


 jason teh wrote:

  PropertyConfigurator.configure(log4j.properties);

 If you are using the above line in your code, then it is assuming that the
log4j.properties file is in the directory that the VM was started - in
tomcat's case, it is either the bin directory (if you are
 starting it from command line) or the root directory (if you are starting
it as a service).

 It is strange that putting in the full path still doesn't do it - you
might want to try out Winfried's suggestion.

 Anuj.


 -
 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

2001-05-07 Thread William Jaynes

The javadocs and the code indicate that
PropertyConfigurator.configure(String) expects String to be the path to
a file. So this method doesn't use the class loader. It's looking for a
filepath, so as Anuj said, using just log4j.properties, the file would
have to be in the directory where the VM started up.

A full filepath name should find the file. Jason, maybe you've got file
separator problems? A '\' instead of a '/'. Idunno.

Will


- Original Message -
From: Dominique JOCAL [EMAIL PROTECTED]
To: LOG4J Users Mailing List [EMAIL PROTECTED]
Sent: Monday, May 07, 2001 8:15 AM
Subject: Re: tomcat and log4j


 Isn't it simply based on the resource loading mechanism ? (i.e. the
file
 has to be available in a root package in the classpath)

 Dominique JOCAL
 Consultant - OCTO Technology
 mailto:[EMAIL PROTECTED]
 tel:+33 6 22 66 09 70
 http://www.octo.com
 - Original Message -
 From: Anuj Agrawal [EMAIL PROTECTED]
 To: LOG4J Users Mailing List [EMAIL PROTECTED]
 Sent: Monday, May 07, 2001 2:05 PM
 Subject: Re: tomcat and log4j


  jason teh wrote:
 
   PropertyConfigurator.configure(log4j.properties);
 
  If you are using the above line in your code, then it is assuming
that the
 log4j.properties file is in the directory that the VM was started - in
 tomcat's case, it is either the bin directory (if you are
  starting it from command line) or the root directory (if you are
starting
 it as a service).
 
  It is strange that putting in the full path still doesn't do it -
you
 might want to try out Winfried's suggestion.
 
  Anuj.
 
 

 -
  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]




Now java error loggin Re: tomcat and log4j

2001-05-07 Thread SCOTT FARQUHAR

You can specify custom error pages, and they can contain scriptlets to log information 
about the error.

Alternatively you could setup Tomcat's error handling (as was already mentioned).

 [EMAIL PROTECTED] 05/08/01 12:00am 
Thanks for you r help guys, ive managed to fix the
problem:)

which now leads me to another question; is there a way
to log the error messages that are generated when
there  is  problem with the tomcat server eg there is
something wrong with the .java class and an error 500
message is spat back at the user. 
Is this something that log4j can take care of or is it
better handled by modifying the tomcat settings?

thanks!
Jason

--- William Jaynes [EMAIL PROTECTED] wrote:  The
javadocs and the code indicate that
 PropertyConfigurator.configure(String) expects
 String to be the path to
 a file. So this method doesn't use the class loader.
 It's looking for a
 filepath, so as Anuj said, using just
 log4j.properties, the file would
 have to be in the directory where the VM started up.
 
 A full filepath name should find the file. Jason,
 maybe you've got file
 separator problems? A '\' instead of a '/'. Idunno.
 
 Will
 
 
 - Original Message -
 From: Dominique JOCAL [EMAIL PROTECTED]
 To: LOG4J Users Mailing List
 [EMAIL PROTECTED]
 Sent: Monday, May 07, 2001 8:15 AM
 Subject: Re: tomcat and log4j
 
 
  Isn't it simply based on the resource loading
 mechanism ? (i.e. the
 file
  has to be available in a root package in the
 classpath)
 
  Dominique JOCAL
  Consultant - OCTO Technology
  mailto:[EMAIL PROTECTED] 
  tel:+33 6 22 66 09 70
  http://www.octo.com 
  - Original Message -
  From: Anuj Agrawal [EMAIL PROTECTED]
  To: LOG4J Users Mailing List
 [EMAIL PROTECTED]
  Sent: Monday, May 07, 2001 2:05 PM
  Subject: Re: tomcat and log4j
 
 
   jason teh wrote:
  
   
 PropertyConfigurator.configure(log4j.properties);
  
   If you are using the above line in your code,
 then it is assuming
 that the
  log4j.properties file is in the directory that the
 VM was started - in
  tomcat's case, it is either the bin directory (if
 you are
   starting it from command line) or the root
 directory (if you are
 starting
  it as a service).
  
   It is strange that putting in the full path
 still doesn't do it -
 you
  might want to try out Winfried's suggestion.
  
   Anuj.
  
  
 
 

-
   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] 
 


_
http://store.yahoo.com.au - Yahoo! Store
- It's time you had your business online!

-
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]