Re: Log4J and Struts

2003-09-23 Thread Mahesh Joshi
Hi,

Unfortunately this does not work for Tomcat 4.1.24

When I put log4j-1.2.8 in the jak*/common/lib or jak*/shared/lib I dont get
the results desired.
In the former, tomcat doesnt startup and in the latter struts does not
initialize.

Looks like I am missing something in the relationship between
commons-logging and Log4J.

Thanks!

Mahesh

- Original Message - 
From: "Abhijeet Mahalkar" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, September 22, 2003 2:39 AM
Subject: Re: Log4J and Struts


hi Mahesh,

No u have to keep ur log4j-1.2.8.jar into websphere\appserver\lib dir not
web-inf.
here it will not give any error.
I was working on the same kind of error an hr before but copy paste into
websphere\appserver\lib solved my problem...

regards
abhijeet

- Original Message - 
From: "Mahesh Joshi" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, September 22, 2003 2:59 PM
Subject: Log4J and Struts


Hi,

I am moving my current web application to struts and I am facing a problem.

We use Log4J for our logging (Log4J version 1.2.8)

If I have the log4j-1.2.8.jar in my WEB-INF/lib directory, the Action
servlet does not initialize

Tomcat log file says:
javax.servlet.ServletException: Error instantiating servlet class
org.apache.struts.action.ActionServlet
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
2)
...
- Root Cause -
java.lang.ExceptionInInitializerError
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:532)
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable
Log constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:432)
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:525)
 ... 28 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
 at java.lang.Class.getDeclaredConstructors0(Native Method)
 at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
 at java.lang.Class.getConstructor0(Class.java:1762)
 at java.lang.Class.getConstructor(Class.java:1002)
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:429)
 ... 29 more


If I remove the log4J.jar from WEB-INF/lib, the ActionServlet
initializes(but then my app. cant log).
I searched the archive and implemented the solution provided by Sgarlata
Matt
http://www.mail-archive.com/[EMAIL PROTECTED]/msg79448.html

Howeve, putting the commons-logging.properties in the WEB-INF/classes/
folder didnt help either.
(note that our log4J config file has been kept in the WEB-INF folder. Even
if I keep the commons-logging.properties in the WEB-INF folder, it doesnt
work).

Please help!

Mahesh


-
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: Log4J and Struts

2003-09-22 Thread Abhijeet Mahalkar
hi Mahesh,

No u have to keep ur log4j-1.2.8.jar into websphere\appserver\lib dir not web-inf. 
here it will not give any error.
I was working on the same kind of error an hr before but copy paste into 
websphere\appserver\lib solved my problem...

regards
abhijeet

- Original Message - 
From: "Mahesh Joshi" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, September 22, 2003 2:59 PM
Subject: Log4J and Struts


Hi,

I am moving my current web application to struts and I am facing a problem.

We use Log4J for our logging (Log4J version 1.2.8)

If I have the log4j-1.2.8.jar in my WEB-INF/lib directory, the Action
servlet does not initialize

Tomcat log file says:
javax.servlet.ServletException: Error instantiating servlet class
org.apache.struts.action.ActionServlet
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
2)
...
- Root Cause -
java.lang.ExceptionInInitializerError
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:532)
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable
Log constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:432)
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:525)
 ... 28 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
 at java.lang.Class.getDeclaredConstructors0(Native Method)
 at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
 at java.lang.Class.getConstructor0(Class.java:1762)
 at java.lang.Class.getConstructor(Class.java:1002)
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:429)
 ... 29 more


If I remove the log4J.jar from WEB-INF/lib, the ActionServlet
initializes(but then my app. cant log).
I searched the archive and implemented the solution provided by Sgarlata
Matt
http://www.mail-archive.com/[EMAIL PROTECTED]/msg79448.html

Howeve, putting the commons-logging.properties in the WEB-INF/classes/
folder didnt help either.
(note that our log4J config file has been kept in the WEB-INF folder. Even
if I keep the commons-logging.properties in the WEB-INF folder, it doesnt
work).

Please help!

Mahesh


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



Log4J and Struts

2003-09-22 Thread Mahesh Joshi
Hi,

I am moving my current web application to struts and I am facing a problem.

We use Log4J for our logging (Log4J version 1.2.8)

If I have the log4j-1.2.8.jar in my WEB-INF/lib directory, the Action
servlet does not initialize

Tomcat log file says:
javax.servlet.ServletException: Error instantiating servlet class
org.apache.struts.action.ActionServlet
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
2)
...
- Root Cause -
java.lang.ExceptionInInitializerError
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:532)
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable
Log constructor [Ljava.lang.Class;@3a5794 for
org.apache.commons.logging.impl.Log4JLogger
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:432)
 at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:525)
 ... 28 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
 at java.lang.Class.getDeclaredConstructors0(Native Method)
 at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
 at java.lang.Class.getConstructor0(Class.java:1762)
 at java.lang.Class.getConstructor(Class.java:1002)
 at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI
mpl.java:429)
 ... 29 more


If I remove the log4J.jar from WEB-INF/lib, the ActionServlet
initializes(but then my app. cant log).
I searched the archive and implemented the solution provided by Sgarlata
Matt
http://www.mail-archive.com/[EMAIL PROTECTED]/msg79448.html

Howeve, putting the commons-logging.properties in the WEB-INF/classes/
folder didnt help either.
(note that our log4J config file has been kept in the WEB-INF folder. Even
if I keep the commons-logging.properties in the WEB-INF folder, it doesnt
work).

Please help!

Mahesh


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



RE: log4j and struts

2002-06-28 Thread Joe Latty

Works a charm, thanks.

Joe

-Original Message-
From: fabrice dewasmes [mailto:[EMAIL PROTECTED]]
Sent: Friday, 28 June 2002 5:48 PM
To: Struts Users Mailing List
Subject: RE: log4j and struts


HI !

I've encountered exactly the same problem : a solution i've used is to
configure your root logger to be high level (say for example ERROR) and
configure your packages to be low level for your debug needs (say for
example com.myCompany to be DEBUG)

this could give this kind of property file :

> log4j.rootCategory=WARN, emslog
log4j.logger.com.foo=DEBUG
> log4j.appender.emslog=org.apache.log4j.RollingFileAppender
> log4j.appender.emslog.File=C:\\somewhereOnMyMachine\\ems.log
> log4j.appender.emslog.layout=org.apache.log4j.PatternLayout
> log4j.appender.emslog.layout.ConversionPattern=%5p %d (%F:%L) - %m%n

As hierarchy plays its role you'll get all categories other than those
beginning with com.foo be in WARN level prventing any traces from Struts. To
be more precise you could also leave the root category as DEBUG but be more
restrictive on org.apache category.

Hope this is clear enough. Don't hesitate if it's not...

Fabrice DEWASMES


> -Message d'origine-
> De : Joe Latty [mailto:[EMAIL PROTECTED]]
> Envoyé : vendredi 28 juin 2002 09:47
> À : Struts Users Mailing List
> Objet : log4j and struts
>
>
> I have set up log4j to run with my app, it all works fine, however I get
> about 1 billion (ok maybe a billion is an exageration) DEBUG lines written
> from struts endless stuff like this;
>
> DEBUG 2002-06-28 17:30:48,317 (Log4JCategoryLog.java:132) -  Validating
> input form properties
> DEBUG 2002-06-28 17:30:48,317 (Log4JCategoryLog.java:115) -   No errors
> detected, accepting input
> DEBUG 2002-06-28 17:30:48,327 (Log4JCategoryLog.java:132) -  Looking for
> Action instance for class com.ems.action.SomethingAction
> DEBUG 2002-06-28 17:30:48,327 (Log4JCategoryLog.java:115) -   Creating new
> Action instance
>
> making it unusable for tracking down app specific debugging.
>
> HELP!
>
>
> In the log4j.properties file
>
> log4j.rootCategory=DEBUG, emslog
> log4j.appender.emslog=org.apache.log4j.RollingFileAppender
> log4j.appender.emslog.File=C:\\somewhereOnMyMachine\\ems.log
> log4j.appender.emslog.layout=org.apache.log4j.PatternLayout
> log4j.appender.emslog.layout.ConversionPattern=%5p %d (%F:%L) - %m%n
>
> then in my classes I have a static variable
>
> static Category cat = Category.getInstance(MyClass.class.getName());
>
> which then does;
>
> cat.debug(theSqlStatement);
>
> Thanks for any help
>


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


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




RE: log4j and struts

2002-06-28 Thread fabrice dewasmes

HI !

I've encountered exactly the same problem : a solution i've used is to
configure your root logger to be high level (say for example ERROR) and
configure your packages to be low level for your debug needs (say for
example com.myCompany to be DEBUG)

this could give this kind of property file :

> log4j.rootCategory=WARN, emslog
log4j.logger.com.foo=DEBUG
> log4j.appender.emslog=org.apache.log4j.RollingFileAppender
> log4j.appender.emslog.File=C:\\somewhereOnMyMachine\\ems.log
> log4j.appender.emslog.layout=org.apache.log4j.PatternLayout
> log4j.appender.emslog.layout.ConversionPattern=%5p %d (%F:%L) - %m%n

As hierarchy plays its role you'll get all categories other than those
beginning with com.foo be in WARN level prventing any traces from Struts. To
be more precise you could also leave the root category as DEBUG but be more
restrictive on org.apache category.

Hope this is clear enough. Don't hesitate if it's not...

Fabrice DEWASMES


> -Message d'origine-
> De : Joe Latty [mailto:[EMAIL PROTECTED]]
> Envoyé : vendredi 28 juin 2002 09:47
> À : Struts Users Mailing List
> Objet : log4j and struts
>
>
> I have set up log4j to run with my app, it all works fine, however I get
> about 1 billion (ok maybe a billion is an exageration) DEBUG lines written
> from struts endless stuff like this;
>
> DEBUG 2002-06-28 17:30:48,317 (Log4JCategoryLog.java:132) -  Validating
> input form properties
> DEBUG 2002-06-28 17:30:48,317 (Log4JCategoryLog.java:115) -   No errors
> detected, accepting input
> DEBUG 2002-06-28 17:30:48,327 (Log4JCategoryLog.java:132) -  Looking for
> Action instance for class com.ems.action.SomethingAction
> DEBUG 2002-06-28 17:30:48,327 (Log4JCategoryLog.java:115) -   Creating new
> Action instance
>
> making it unusable for tracking down app specific debugging.
>
> HELP!
>
>
> In the log4j.properties file
>
> log4j.rootCategory=DEBUG, emslog
> log4j.appender.emslog=org.apache.log4j.RollingFileAppender
> log4j.appender.emslog.File=C:\\somewhereOnMyMachine\\ems.log
> log4j.appender.emslog.layout=org.apache.log4j.PatternLayout
> log4j.appender.emslog.layout.ConversionPattern=%5p %d (%F:%L) - %m%n
>
> then in my classes I have a static variable
>
> static Category cat = Category.getInstance(MyClass.class.getName());
>
> which then does;
>
> cat.debug(theSqlStatement);
>
> Thanks for any help
>


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




log4j and struts

2002-06-28 Thread Joe Latty

I have set up log4j to run with my app, it all works fine, however I get
about 1 billion (ok maybe a billion is an exageration) DEBUG lines written
from struts endless stuff like this;

DEBUG 2002-06-28 17:30:48,317 (Log4JCategoryLog.java:132) -  Validating
input form properties
DEBUG 2002-06-28 17:30:48,317 (Log4JCategoryLog.java:115) -   No errors
detected, accepting input
DEBUG 2002-06-28 17:30:48,327 (Log4JCategoryLog.java:132) -  Looking for
Action instance for class com.ems.action.SomethingAction
DEBUG 2002-06-28 17:30:48,327 (Log4JCategoryLog.java:115) -   Creating new
Action instance

making it unusable for tracking down app specific debugging.

HELP!


In the log4j.properties file

log4j.rootCategory=DEBUG, emslog
log4j.appender.emslog=org.apache.log4j.RollingFileAppender
log4j.appender.emslog.File=C:\\somewhereOnMyMachine\\ems.log
log4j.appender.emslog.layout=org.apache.log4j.PatternLayout
log4j.appender.emslog.layout.ConversionPattern=%5p %d (%F:%L) - %m%n

then in my classes I have a static variable

static Category cat = Category.getInstance(MyClass.class.getName());

which then does;

cat.debug(theSqlStatement);

Thanks for any help



Problem with log4j and struts - log info going to 2 files.

2002-04-07 Thread Antony Stace

Hi Folks

I am trying to setup log4j with struts.  I have added to each of the
files I want log messages for

static Category cat = Category.getInstance(ClassName.class.getName() );

and then when I want to write to the log file I have added

cat.debug("Debug message");

this is working fine except I have output written to both

/var/tomcat4/log/catalina.out
and file I have defined in log4j.properties as the output file.
 log4j.appender.A2.file=/var/tomcat4/logs/testApp.log

How can I configure log4j so it only writes to log4j.appender.A2.file and 
doesn't write anything to 

/var/tomcat4/log/catalina.out

Thanks for your help.

Cheers

Tony





_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Log4J and Struts - using Chiki's log4j configuration and getting tons of messages

2002-02-13 Thread Emaho, Ghoot

Hi Matt
 
I can only assume that the initial error (when you have no log4j.properties file) is 
down to the extensions you are using being dependant on log4j - which means you need 
the properties file so it knows what to do.
 
Using the Chiki log4j sorts this out - but there are a couple of things which may be 
giving you too much detail in your logs.
 
The category definitions only affect logging messages going thru that category, so 
changing them in the properties file will only affect the messages which go thru that 
category. Then there is the debug level as detailed in your web.xml
 
One question to consider is which category the messages are coming through (from one 
of the extensions), and then include THAT category in your log4j properties file at 
the appropriate level. You should find some mention of the Category in use in the 
extensions documentation. By using the Chiki config for log4j, the used Category isnt 
mentioned - isnt set to any level - so you're getting all the messages. By including 
it and setting the level as required will reduce the number of messages.
I'd check your web.xml too. As the one included here doesn't have debug levels set to 
zero...I'm not totally familiar with the extensions you are using (yet) but the 
messages must be coming from them if you are not using any loggin in your app yet. So 
check the docs that come with them (and examples) for any mention of the log4j 
dependancy and configuration re the Category being used..

Hope this helps

Ghoot

 
 

-Original Message-
From: Matt Raible [mailto:[EMAIL PROTECTED]]
Sent: 12 February 2002 23:50
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Log4J and Struts - using Chiki's log4j configuration and getting tons of 
messages



Hello,

I am trying to implement log4j in my application.  I'm using the Struts nightly build. 
 If I don't have a log4j.properties file in my WEB-INF/classes directory, I get the 
following error:

log4j:ERROR No appenders could be found for category (org.apache.commons.digester).

log4j:ERROR Please initialize the log4j system properly.

I think this is being kicked off my one of the servlets in my web.xml because I 
haven't even written any code yet, but I am using Validator, Workflow and Tiles.  

So I copied the log4j.cfg file from Chiki's WEB-INF directory, renamed and put in in 
its place.  Now I get more logging messages than I can stand, and I have changed all 
the debug and detail values in web.xml to 0.  My log file on startup is over 1000 
lines long.  

Does anyone have any idea how to configure this properly - or point me towards a 
resource that does.  A simple "search the archives" is fine as well.

Thanks,

Matt

Log4j.properties file:

log4j.rootCategory=debug, stdout, R

log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.

log4j.appender.stdout.layout.ConversionPattern=%p [%t] [%c] %C{1}.%M(%L) | %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender

log4j.appender.R.File=onpoint.log

log4j.appender.R.MaxFileSize=100KB

# Keep one backup file

log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout

log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

log4j.category.Init=DEBUG

log4j.category.Config=DEBUG

log4j.category.Actions=DEBUG

log4j.category.Repository=DEBUG

log4j.category.Persister=DEBUG

log4j.category.Translator=DEBUG

log4j.category.Cache=DEBUG

log4j.category.Validator=DEBUG

log4j.category.Registry=DEBUG

log4j.category.Event=DEBUG

First few lines of my log file:

DEBUG main org.apache.commons.digester - Pop org.apache.struts.action.ActionForward

DEBUG main org.apache.commons.digester - ignorableWhitespace(

)

DEBUG main org.apache.commons.digester - endElement(,action,action)

Here are the servlets in my web.xml:





registry


com.onpoint.webapp.workflow.RegistryServlet



registry

/WEB-INF/workflow.xml





debug

999





detail

999



1







wizard


org.apache.commons.workflow.web.ActivityServlet



activity

/WEB-INF/workflow.xml





debug

999





detail

999



1







validator


com.wintecinc.struts.action.Valida

Log4J and Struts - using Chiki's log4j configuration and getting tons of messages

2002-02-12 Thread Matt Raible

Hello,

I am trying to implement log4j in my application.  I'm using the Struts
nightly build.  If I don't have a log4j.properties file in my
WEB-INF/classes directory, I get the following error:

log4j:ERROR No appenders could be found for category
(org.apache.commons.digester).
log4j:ERROR Please initialize the log4j system properly.

I think this is being kicked off my one of the servlets in my web.xml
because I haven't even written any code yet, but I am using Validator,
Workflow and Tiles.  

So I copied the log4j.cfg file from Chiki's WEB-INF directory, renamed
and put in in its place.  Now I get more logging messages than I can
stand, and I have changed all the debug and detail values in web.xml to
0.  My log file on startup is over 1000 lines long.  

Does anyone have any idea how to configure this properly - or point me
towards a resource that does.  A simple "search the archives" is fine as
well.

Thanks,

Matt

Log4j.properties file:

log4j.rootCategory=debug, stdout, R

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%p [%t] [%c] %C{1}.%M(%L)
| %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=onpoint.log

log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

log4j.category.Init=DEBUG
log4j.category.Config=DEBUG
log4j.category.Actions=DEBUG
log4j.category.Repository=DEBUG
log4j.category.Persister=DEBUG
log4j.category.Translator=DEBUG
log4j.category.Cache=DEBUG
log4j.category.Validator=DEBUG
log4j.category.Registry=DEBUG
log4j.category.Event=DEBUG

First few lines of my log file:

DEBUG main org.apache.commons.digester - Pop
org.apache.struts.action.ActionForward
DEBUG main org.apache.commons.digester - ignorableWhitespace(
)
DEBUG main org.apache.commons.digester - endElement(,action,action)

Here are the servlets in my web.xml:



registry

com.onpoint.webapp.workflow.RegistryServlet

registry
/WEB-INF/workflow.xml


debug
999


detail
999

1



wizard

org.apache.commons.workflow.web.ActivityServlet

activity
/WEB-INF/workflow.xml


debug
999


detail
999

1



validator

com.wintecinc.struts.action.ValidatorServlet

config

/WEB-INF/validator.xml


debug
2

2



action

org.apache.struts.tiles.ActionComponentServlet

definitions-config

/WEB-INF/tiles-config.xml


definitions-debug
1



definitions-parser-details
0



definitions-parser-validate
true


application
ApplicationResources


config

/WEB-INF/struts-config.xml


debug
2


detail
3


validate
true

2




RE: Log4J and Struts

2001-11-22 Thread Tom Klaasen (TeleRelay)

OK, didn't know that. I've only used Tomcat so far (and SilverStream in
a dark and far-away past)

tomK


> -Original Message-
> From: Stefano Mancarella [mailto:[EMAIL PROTECTED]] 
> Sent: donderdag 22 november 2001 15:22
> To: Struts Users Mailing List
> Subject: Re: Log4J and Struts
> 
> 
> > Startup servlet? I have no need for that one - either you name your
> > property file log4j.properties, or you specify the 
> environment variable
> > log4j.configuration, and log4j will pick it up by itself.
> 
> Remember that this doesn't work if log4j as been already configured
> elsewhere. F.e. this happens if you use JBoss with embedded 
> Tomcat (which
> uses log4j for its own logging purposes).
> The init servlet approach is guaranteed to work everytime and 
> everywhere,
> that's why I prefer it.
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 

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




Re: Log4J and Struts

2001-11-22 Thread Stefano Mancarella

> Startup servlet? I have no need for that one - either you name your
> property file log4j.properties, or you specify the environment variable
> log4j.configuration, and log4j will pick it up by itself.

Remember that this doesn't work if log4j as been already configured
elsewhere. F.e. this happens if you use JBoss with embedded Tomcat (which
uses log4j for its own logging purposes).
The init servlet approach is guaranteed to work everytime and everywhere,
that's why I prefer it.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




AW: Log4J and Struts

2001-11-22 Thread Hudayioglu, Fehmi

Hi,

We have subclassed the ActionServlet and loaded the our log4j Config
file in the servlet init() method. You can put the config where you 
like - we specify the location in a Servlet initialisation parameter. 
We prefer to use a config file since we can configure our categories in
one place. If you are just using the root category with no special appender
a config file is probably sufficient. Have fun !

Ben

-Ursprüngliche Nachricht-
Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]]
Gesendet am: Thursday, November 22, 2001 11:10 AM
An: Struts Users Mailing List
Betreff: RE: Log4J and Struts

Startup servlet? I have no need for that one - either you name your
property file log4j.properties, or you specify the environment variable
log4j.configuration, and log4j will pick it up by itself.

Thus I have _no_ initialization code for log4j. The only things that are
changed in my code is "import org.apache.log4j.Category;" and "private
static final Category logcat = Category.getInstance(MyClass.class);".
This is precisely what makes log4j superior to all other logging
mechanisms I've yet seen (though I have to admit I don't study them all,
because I'm more than content with log4j).

tomK


> -Original Message-
> From: juraj Lenharcik [mailto:[EMAIL PROTECTED]] 
> Sent: donderdag 22 november 2001 11:05
> To: 'Struts Users Mailing List'
> Subject: AW: Log4J and Struts
> 
> 
> i have it in web-inf/classes and will be invoced by a startup servlet.
> 
> -Ursprüngliche Nachricht-
> Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 22. November 2001 10:30
> An: Struts Users Mailing List
> Betreff: RE: Log4J and Struts
> 
> 
> Somewhere in the classpath. For Tomcat, I put it in
> TOMCAT_HOME/webapps//WEB-INF/classes
> 
> hth,
> tomK
> 
> > -Original Message-
> > From: storck [mailto:[EMAIL PROTECTED]] 
> > Sent: donderdag 22 november 2001 9:30
> > To: Struts User (E-Mail)
> > Subject: Log4J and Struts
> > 
> > 
> > Hi,
> > 
> > where must I put the config-file for Log4J so I can use log4j 
> > within struts?
> > 
> > Many thanks!
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:struts-user-> [EMAIL PROTECTED]>
> > For 
> > additional commands, 
> > e-mail: <mailto:[EMAIL PROTECTED]>
> > 
> > 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 

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

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




AW: Log4J and Struts

2001-11-22 Thread juraj Lenharcik

thanks for the tip. i will try it.

- juraj

-Ursprüngliche Nachricht-
Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 22. November 2001 11:10
An: Struts Users Mailing List
Betreff: RE: Log4J and Struts


Startup servlet? I have no need for that one - either you name your
property file log4j.properties, or you specify the environment variable
log4j.configuration, and log4j will pick it up by itself.

Thus I have _no_ initialization code for log4j. The only things that are
changed in my code is "import org.apache.log4j.Category;" and "private
static final Category logcat = Category.getInstance(MyClass.class);".
This is precisely what makes log4j superior to all other logging
mechanisms I've yet seen (though I have to admit I don't study them all,
because I'm more than content with log4j).

tomK


> -Original Message-
> From: juraj Lenharcik [mailto:[EMAIL PROTECTED]] 
> Sent: donderdag 22 november 2001 11:05
> To: 'Struts Users Mailing List'
> Subject: AW: Log4J and Struts
> 
> 
> i have it in web-inf/classes and will be invoced by a startup servlet.
> 
> -Ursprüngliche Nachricht-
> Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 22. November 2001 10:30
> An: Struts Users Mailing List
> Betreff: RE: Log4J and Struts
> 
> 
> Somewhere in the classpath. For Tomcat, I put it in
> TOMCAT_HOME/webapps//WEB-INF/classes
> 
> hth,
> tomK
> 
> > -Original Message-
> > From: storck [mailto:[EMAIL PROTECTED]] 
> > Sent: donderdag 22 november 2001 9:30
> > To: Struts User (E-Mail)
> > Subject: Log4J and Struts
> > 
> > 
> > Hi,
> > 
> > where must I put the config-file for Log4J so I can use log4j 
> > within struts?
> > 
> > Many thanks!
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:struts-user-> [EMAIL PROTECTED]>
> > For 
> > additional commands, 
> > e-mail: <mailto:[EMAIL PROTECTED]>
> > 
> > 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 

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

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




RE: Log4J and Struts

2001-11-22 Thread Tom Klaasen (TeleRelay)

Startup servlet? I have no need for that one - either you name your
property file log4j.properties, or you specify the environment variable
log4j.configuration, and log4j will pick it up by itself.

Thus I have _no_ initialization code for log4j. The only things that are
changed in my code is "import org.apache.log4j.Category;" and "private
static final Category logcat = Category.getInstance(MyClass.class);".
This is precisely what makes log4j superior to all other logging
mechanisms I've yet seen (though I have to admit I don't study them all,
because I'm more than content with log4j).

tomK


> -Original Message-
> From: juraj Lenharcik [mailto:[EMAIL PROTECTED]] 
> Sent: donderdag 22 november 2001 11:05
> To: 'Struts Users Mailing List'
> Subject: AW: Log4J and Struts
> 
> 
> i have it in web-inf/classes and will be invoced by a startup servlet.
> 
> -Ursprüngliche Nachricht-
> Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 22. November 2001 10:30
> An: Struts Users Mailing List
> Betreff: RE: Log4J and Struts
> 
> 
> Somewhere in the classpath. For Tomcat, I put it in
> TOMCAT_HOME/webapps//WEB-INF/classes
> 
> hth,
> tomK
> 
> > -Original Message-
> > From: storck [mailto:[EMAIL PROTECTED]] 
> > Sent: donderdag 22 november 2001 9:30
> > To: Struts User (E-Mail)
> > Subject: Log4J and Struts
> > 
> > 
> > Hi,
> > 
> > where must I put the config-file for Log4J so I can use log4j 
> > within struts?
> > 
> > Many thanks!
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:struts-user-> [EMAIL PROTECTED]>
> > For 
> > additional commands, 
> > e-mail: <mailto:[EMAIL PROTECTED]>
> > 
> > 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 

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




AW: Log4J and Struts

2001-11-22 Thread juraj Lenharcik

i have it in web-inf/classes and will be invoced by a startup servlet.

-Ursprüngliche Nachricht-
Von: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 22. November 2001 10:30
An: Struts Users Mailing List
Betreff: RE: Log4J and Struts


Somewhere in the classpath. For Tomcat, I put it in
TOMCAT_HOME/webapps//WEB-INF/classes

hth,
tomK

> -Original Message-
> From: storck [mailto:[EMAIL PROTECTED]] 
> Sent: donderdag 22 november 2001 9:30
> To: Struts User (E-Mail)
> Subject: Log4J and Struts
> 
> 
> Hi,
> 
> where must I put the config-file for Log4J so I can use log4j 
> within struts?
> 
> Many thanks!
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 

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

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




RE: Log4J and Struts

2001-11-22 Thread Tom Klaasen (TeleRelay)

Somewhere in the classpath. For Tomcat, I put it in
TOMCAT_HOME/webapps//WEB-INF/classes

hth,
tomK

> -Original Message-
> From: storck [mailto:[EMAIL PROTECTED]] 
> Sent: donderdag 22 november 2001 9:30
> To: Struts User (E-Mail)
> Subject: Log4J and Struts
> 
> 
> Hi,
> 
> where must I put the config-file for Log4J so I can use log4j 
> within struts?
> 
> Many thanks!
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 

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




Log4J and Struts

2001-11-22 Thread storck

Hi,

where must I put the config-file for Log4J so I can use log4j within struts?

Many thanks!


--
To unsubscribe, e-mail:   
For additional commands, e-mail: