RE: Tomcat

2002-11-25 Thread Koes, Derrick

True, the unpackWars property must be true.
However, there is no "configureAndWatch" method which takes a URL.
If using configure, you will only pick up changes by restarting the server.

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] 
Sent: Monday, November 25, 2002 2:25 PM
To: Log4J Users List
Subject: RE: Tomcat

Hi,

>I do a similar thing as Yoav suggests.
>
>String systemId =
getServletContext().getRealPath("/conf/logconfig.xml");
>DOMConfigurator.configureAndWatch(systemId, logConfigWatch);

Note a key difference between my suggestion and the above: the above
will not work if you're deploying out of a .war file.  getRealPath() for
anything returns null if inside a .war.

Thankfully you should be able to substitute getResource() for
getRealPath() as the configurator api supports the configure(URL url)
methods.

Yoav Shapira
Millennium ChemInformatics

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 
This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.

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




RE: Tomcat

2002-11-25 Thread Koes, Derrick


I've had problems with tomcat not picking up my xml configuration file in
web-inf/classes.

I do a similar thing as Yoav suggests.

String systemId = getServletContext().getRealPath("/conf/logconfig.xml");
DOMConfigurator.configureAndWatch(systemId, logConfigWatch);




-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] 
Sent: Monday, November 25, 2002 1:39 PM
To: Log4J Users List
Subject: RE: Tomcat

Howdy,

>> To start with:
>> - Where is the properties file? Currently, in the servlet's
WEB-INF/lib
>> (though it's a log4j.xml rather than a properties file)
>
>Try putting it in WEB-INF/classes.  I think Tomcat only adds *jar*
files in
>WEB-INF/lib to the classpath.

This is true.  But you can still do:

URL propsFileURL =
getServletContext().getResource("/WEB-INF/lib/log4j.prop");
PropertyConfigurator.configure(propsFileURL);
...

Yoav Shapira
Millennium ChemInformatics

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 
This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.

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




RE: log4j.dtd not found ?

2002-11-21 Thread Koes, Derrick

Is the SYSTEM path to log4j.dtd in your XML configuration file correct?

You might try:

jar:file:/path/to/jar/log4j-1.2.6.jar!/org/apache/log4j/xml/log4j.dtd

-Original Message-
From: Clive Beavis [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, November 20, 2002 5:06 PM
To: [EMAIL PROTECTED]
Subject: log4j.dtd not found ?

I have a weblogic 7 application making extensive use of Log4j (1.2.6). I am
attempting to convert the configuration properties file over to XML

I have done this and it works, including finding the log4j.dtd.  however
during initialization I still get the message

"log4j:ERROR Could not find [log4j.dtd]. Used
[sun.misc.Launcher$AppClassLoader@2c3c08] class loader in the search."

I know some part of the initialization is finding it because my
configuration is set up and runs correctly.

Does anyone know where it is expecting to find this second copy of
log4j.dtd, and if/why two separate location are necessary.


I have tried all the usual/obvious places I think.


Thanks



Clive Beavis

650 464 2604



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 
This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.

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




RE: log4j

2002-09-20 Thread Koes, Derrick



You can make one appender "inherit" from another appender using a specific
naming convention.  The two files is not a problem since each appender will
append to its own file.
This is a DOMConfigurator example, but I think the same holds for properties
(Can someone verify?).






  

  

  




  

  


So, anything you log to B will go to A.


-Original Message-
From: Arun Jannela [mailto:[EMAIL PROTECTED]] 
Sent: Friday, September 20, 2002 5:54 AM
To: Log4J Users List
Subject: log4j



Hi,
How can I add two appennders and two log files for the same JSP file.

Regards,
Arun Jannela



This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.


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




Request for working log4j configuration file (properties or XML) in Tomcat 4.0.4

2002-09-19 Thread Koes, Derrick

If anyone has a working log4j configuration file that they are using in
Tomcat 4.0.4, please forward.

 

I always get the no appenders warnings.

log4j:WARN No appenders could be found for logger (DoraLogger).

log4j:WARN Please initialize the log4j system properly.

 

The following configuration file in my webapp's web-inf/classes directory
never gets read.





 



 

  





  

 

  









  



  

 

  



  

 

  









  



  

 

  





  



  

 

  



  

 

  



  

 

  

  







  

 



This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.



RE: configuration problem

2002-09-11 Thread Koes, Derrick


After a bit of agony, I figured out a bit of a pattern--I think.

If I start tomcat from the command prompt, then I see logging (and the log4j
internal debug statements).

However, if I run tomcat from the start menu or as an NT service I get no
logging.

I don't know how to fix this.  This indicates to me a resource or timing
issue--I think.

Can anyone help?


-Original Message-
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 11, 2002 1:40 PM
To: Log4J Users List
Subject: RE: configuration problem


Check that the JVM that launches Tomcat sees your options. Look into 
catalina.sh or catalina.bat.

At 13:38 11.09.2002 -0400, you wrote:

>Any suggestions on what to check next?
>
>-Original Message-
>From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, September 11, 2002 1:30 PM
>To: Log4J Users List
>Subject: RE: configuration problem
>
>
>debug=true makes log4j emit internal messages. The fact that you are not
>seeing any change means that the config file (logconfig.xml) is not being
>read.
>
>At 13:24 11.09.2002 -0400, you wrote:
>
> >What is the 'debug="true"' supposed to do?
> >I did this and did not notice anything different.
> >
> >Yes, logconfig.xml is in WEB-INF/classes/.
> >
> >-Original Message-
> >From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
> >Sent: Wednesday, September 11, 2002 12:57 PM
> >To: Log4J Users List
> >Subject: Re: configuration problem
> >
> >
> >Looks good to me. Change
> >
> >
> >
> >to
> >
> > >xmlns:log4j='http://jakarta.apache.org/log4j/'>
> >
> >and see what happens.
> >
> >Where have you placed the logconfig.xml file? Is it in WEB-INF/classes/ ?
> >
> >At 12:56 11.09.2002 -0400, you wrote:
> > >When I run my web app I get:
> > >
> > >log4j:WARN No appenders could be found for logger (DoraLogger).
> > >log4j:WARN Please initialize the log4j system properly.
> > >
> > >I cannot figure out why.  I believe I have things configured correctly.
> >
> >[snip]
> >
> >
> >--
> >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:
>
> >For additional commands, e-mail:
>
> >
> >
> >--
> >To unsubscribe, e-mail:
>
> >For additional commands, e-mail:
>
>
>--
>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:

>For additional commands, e-mail:

>
>
>--
>To unsubscribe, e-mail:

>For additional commands, e-mail:


--
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:   
For additional commands, e-mail: 


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




RE: configuration problem

2002-09-11 Thread Koes, Derrick


Any suggestions on what to check next?

-Original Message-
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 11, 2002 1:30 PM
To: Log4J Users List
Subject: RE: configuration problem


debug=true makes log4j emit internal messages. The fact that you are not 
seeing any change means that the config file (logconfig.xml) is not being
read.

At 13:24 11.09.2002 -0400, you wrote:

>What is the 'debug="true"' supposed to do?
>I did this and did not notice anything different.
>
>Yes, logconfig.xml is in WEB-INF/classes/.
>
>-Original Message-
>From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, September 11, 2002 12:57 PM
>To: Log4J Users List
>Subject: Re: configuration problem
>
>
>Looks good to me. Change
>
>
>
>to
>
>xmlns:log4j='http://jakarta.apache.org/log4j/'>
>
>and see what happens.
>
>Where have you placed the logconfig.xml file? Is it in WEB-INF/classes/ ?
>
>At 12:56 11.09.2002 -0400, you wrote:
> >When I run my web app I get:
> >
> >log4j:WARN No appenders could be found for logger (DoraLogger).
> >log4j:WARN Please initialize the log4j system properly.
> >
> >I cannot figure out why.  I believe I have things configured correctly.
>
>[snip]
>
>
>--
>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:

>For additional commands, e-mail:

>
>
>--
>To unsubscribe, e-mail:

>For additional commands, e-mail:


--
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:   
For additional commands, e-mail: 


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




RE: configuration problem

2002-09-11 Thread Koes, Derrick


What is the 'debug="true"' supposed to do?
I did this and did not notice anything different.

Yes, logconfig.xml is in WEB-INF/classes/.

-Original Message-
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 11, 2002 12:57 PM
To: Log4J Users List
Subject: Re: configuration problem


Looks good to me. Change



to



and see what happens.

Where have you placed the logconfig.xml file? Is it in WEB-INF/classes/ ?

At 12:56 11.09.2002 -0400, you wrote:
>When I run my web app I get:
>
>log4j:WARN No appenders could be found for logger (DoraLogger).
>log4j:WARN Please initialize the log4j system properly.
>
>I cannot figure out why.  I believe I have things configured correctly.

[snip]


--
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:   
For additional commands, e-mail: 


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




configuration problem

2002-09-11 Thread Koes, Derrick

When I run my web app I get:

 

log4j:WARN No appenders could be found for logger (DoraLogger).

log4j:WARN Please initialize the log4j system properly.

 

I cannot figure out why.  I believe I have things configured correctly.

Below is my configuration.

Can anyone help?

 

 

 

W2K Pro

Tomcat 4.0.4

Log4j 1.2.26

Java 2 SDK 1.4.0_02

 

Log 4j configuration file logconfig.xml from the classes directory of my
webapp:

 





 



 

  





  

 

  









  



  

 

  



  

 

  









  



  

 

  





  



  

 

  



  

 

  



  

 

  

  







  

 



 

 

Environment variable CATALINA_OPTS= -Dlog4j.configuration=logconfig.xml
-Dlog4j.configuratorClass=org.apache.log4j.xml.DOMConfigurator

 

 

 




FW: log4j in tomcat

2002-07-31 Thread Koes, Derrick



-Original Message-
From: Koes, Derrick 
Sent: Wednesday, July 31, 2002 12:13 PM
To: 'Tomcat Users List'
Cc: '[EMAIL PROTECTED]'; Courtney, Brian; Monnelly, Susan;
Chamarthi, Harish
Subject: RE: log4j in tomcat

The long-winded answer was fine and helpful.  That's what I wanted to know,
but there is a bit more.

Actually, I haven't modified either of the bat files you mention.

I simply followed option 1 in the log4j short manual for logging in tomcat
4.x.  This follows:

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

You can also choose to set the system property log4j.configuration before
starting Tomcat. For Tomcat 3.x The TOMCAT_OPTS environment variable is used
to set command line options. For Tomcat 4.0, set the CATALINA_OPTS
environment variable instead of TOMCAT_OPTS. 



-Original Message-
From: Charles N. Harvey III [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 31, 2002 10:01 AM
To: Tomcat Users List
Subject: RE: log4j in tomcat

I think I know what the problem is.  To add log4j to Tomcat you added an
extra parameter to either startup.bat or catalina.bat right?  (I can't
remember which one.)  So when you start Tomcat from the start menu it
reads the change you made in the file.

Thing is, when Tomcat starts as a service it DOES NOT read that change
that you made.  Doh!  Here's why.  The installer creates the service like
any other service gets made - with the command prompt.  That's what the
tomcat.exe file is for in your /bin directory.  It does not run Tomcat,
it installs it as a service.  But, it installs with the same set of
parameters
as in the original (catalina|startup).bat file.

So what has to be done is that you must remove the Tomcat service and
re-install it all from the command prompt.  And here is a link to a web
page made by some really nice people that know more about it than me.

http://www.alexandriasc.com/software/JavaService/index.html

They have made a seperate file called JavaService.exe to run the command
against instead of Tomcat.exe.  The documentation page on that site explains
how to install everything and all the parameters you can set.

The only thing not explained is how to remove the Tomcat Service.
> Tomcat.exe -uninstall "Service Name"
(Enter the exact name, with spaces, that you see in the services menu.

The command you enter will look something like this - take note of the log4j
part:

 > "%CATALINA_HOME%\bin\tomcat.exe" -install "Apache Tomcat"
"%JAVA_HOME%\jre\bin\hotspot\jvm.dll"
-Dlog4j.configuration=/WEB-INF/conf/log4j.properties
-Djava.class.path="%CATALINA_START%" -Dcatalina.home="%CATALINA_HOME%" -Xrs
-start org.apache.catalina.startup.Bootstrap -params start
-stop org.apache.catalina.startup.Bootstrap -params stop
-out "%CATALINA_HOME%"\logs\stderr.log

Yeah, long.  But if you look at your (startup|catalina).bat file it will
look
similar.

Hope this answers your questions - I know my answers are long winded.

Charlie



> -Original Message-
> From: Koes, Derrick [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 8:40 AM
> To: 'Tomcat Users List'
> Subject: log4j in tomcat
>
>
> If I start Tomcat as an NT service I get the WARNings that no log4j
> appenders could be found.
>
> If I start Tomcat from the start menu everything works as
> expected and I get
> my logs.
>
>
>
> Has anyone seen this behavior?
>
> Is there an explanation?  I'm guessing some kind of timing issue.
>
>


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



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




RE: log4j in tomcat

2002-07-31 Thread Koes, Derrick

The long-winded answer was fine and helpful.  That's what I wanted to know,
but there is a bit more.

Actually, I haven't modified either of the bat files you mention.

I simply followed option 1 in the log4j short manual for logging in tomcat
4.x.  This follows:

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

You can also choose to set the system property log4j.configuration before
starting Tomcat. For Tomcat 3.x The TOMCAT_OPTS environment variable is used
to set command line options. For Tomcat 4.0, set the CATALINA_OPTS
environment variable instead of TOMCAT_OPTS. 



-Original Message-
From: Charles N. Harvey III [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 31, 2002 10:01 AM
To: Tomcat Users List
Subject: RE: log4j in tomcat

I think I know what the problem is.  To add log4j to Tomcat you added an
extra parameter to either startup.bat or catalina.bat right?  (I can't
remember which one.)  So when you start Tomcat from the start menu it
reads the change you made in the file.

Thing is, when Tomcat starts as a service it DOES NOT read that change
that you made.  Doh!  Here's why.  The installer creates the service like
any other service gets made - with the command prompt.  That's what the
tomcat.exe file is for in your /bin directory.  It does not run Tomcat,
it installs it as a service.  But, it installs with the same set of
parameters
as in the original (catalina|startup).bat file.

So what has to be done is that you must remove the Tomcat service and
re-install it all from the command prompt.  And here is a link to a web
page made by some really nice people that know more about it than me.

http://www.alexandriasc.com/software/JavaService/index.html

They have made a seperate file called JavaService.exe to run the command
against instead of Tomcat.exe.  The documentation page on that site explains
how to install everything and all the parameters you can set.

The only thing not explained is how to remove the Tomcat Service.
> Tomcat.exe -uninstall "Service Name"
(Enter the exact name, with spaces, that you see in the services menu.

The command you enter will look something like this - take note of the log4j
part:

 > "%CATALINA_HOME%\bin\tomcat.exe" -install "Apache Tomcat"
"%JAVA_HOME%\jre\bin\hotspot\jvm.dll"
-Dlog4j.configuration=/WEB-INF/conf/log4j.properties
-Djava.class.path="%CATALINA_START%" -Dcatalina.home="%CATALINA_HOME%" -Xrs
-start org.apache.catalina.startup.Bootstrap -params start
-stop org.apache.catalina.startup.Bootstrap -params stop
-out "%CATALINA_HOME%"\logs\stderr.log

Yeah, long.  But if you look at your (startup|catalina).bat file it will
look
similar.

Hope this answers your questions - I know my answers are long winded.

Charlie



> -Original Message-
> From: Koes, Derrick [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 8:40 AM
> To: 'Tomcat Users List'
> Subject: log4j in tomcat
>
>
> If I start Tomcat as an NT service I get the WARNings that no log4j
> appenders could be found.
>
> If I start Tomcat from the start menu everything works as
> expected and I get
> my logs.
>
>
>
> Has anyone seen this behavior?
>
> Is there an explanation?  I'm guessing some kind of timing issue.
>
>


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




NT Event Viewer dll question

2002-07-09 Thread Koes, Derrick

I'm using log4j in my web app.  I'm also using the dll that allows logging
to the NT Event Viewer application log.

However, I cannot use the manager servlet to undeploy and redeploy an
updated version of my web app because of a stack trace produced that states
that the dll is already loaded.

Is there any way to configure log4j/tomcat to check for this?

 

Thanks,

Derrick

 




RE: NTEventLogAppender

2002-06-18 Thread Koes, Derrick


User error.  The dll must be in %SystemRoot%/System32 specifically.  It
cannot merely be on the path.


-Original Message-
From: Koes, Derrick 
Sent: Tuesday, June 18, 2002 11:08 AM
To: '[EMAIL PROTECTED]'
Subject: NTEventLogAppender

 

I added the NTEventLogAppender.dll to the path and I'm seeing it as part of
the java.library.path property, but I still get the exception warned about
in the javadoc.

 

java.lang.UnsatisfiedLinkError: no NTEventLogAppender in java.library.path

Does anyone have any ideas?



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




NTEventLogAppender

2002-06-18 Thread Koes, Derrick

 

I added the NTEventLogAppender.dll to the path and I'm seeing it as part of
the java.library.path property, but I still get the exception warned about
in the javadoc.

 

java.lang.UnsatisfiedLinkError: no NTEventLogAppender in java.library.path

Does anyone have any ideas?