RE: logging question

2004-11-23 Thread Shapira, Yoav

Hi,
Attributes are case-sensitive: it's swallowOutput, not SwallowOutput or
another variant.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Scott Pippin [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, November 23, 2004 3:29 PM
>To: [EMAIL PROTECTED]
>Subject: logging question
>
>I am trying to redirect standard out to a different file for a
>particular application.  I have tried to set up a context.xml file but
>everything is still being written to catalina.out.
>
>server.xml
>
>
>  className="org.apache.catalina.mbeans.ServerLifecycleListener"
>debug="0"/>
>  className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
>debug="0"/>
>  
>value="30"/>
>  type="org.apache.catalina.UserDatabase"
>   description="User database that can be updated and saved">
>
>
>  
>factory
>
>org.apache.catalina.users.MemoryUserDatabaseFactory
>  
>  
>pathname
>conf/tomcat-users.xml
>  
>
>  
>  
>   maxThreads="150" minSpareThreads="25"
>maxSpareThreads="75"
>   enableLookups="false" redirectPort="8443"
>acceptCount="100"
>   debug="0" connectionTimeout="2"
>   disableUploadTimeout="true" />
>   enableLookups="false" redirectPort="8443" debug="0"
>   protocol="AJP/1.3" />
>
>prefix="catalina_log." suffix=".txt"
>  timestamp="true" swallowOutput="true" />
> connectionName="xxx" connectionPassword="xxx"
>  connectionURL="jdbc:mysql://x.x.x.x:3306/xxx"
>driverName="com.mysql.jdbc.Driver" userTable="imsuser"
>  userNameCol="userid" userCredCol="passwordid" userRoleTable="imsrole"
>roleNameCol="userrole" />
> unpackWARs="true" autoDeploy="true"
>   xmlValidation="false" xmlNamespaceAware="false">
> directory="logs"  prefix="localhost_log."
>suffix=".txt"
>timestamp="true" swallowOutput="true" />
>  
>
>  
>
>
>context.xml
>
>docBase="/u1/Apache/tomcat/webapps/IMS">
> directory="logs" prefix="ims_log." suffix=".txt" timestamp="true"
>SwallowOutput="true" />
>
>
>Thanks in Advance,
>
>Scott Pippin



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]



logging question

2004-11-23 Thread Scott Pippin
I am trying to redirect standard out to a different file for a
particular application.  I have tried to set up a context.xml file but
everything is still being written to catalina.out.
 
server.xml
 

  
  
  




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

  
  



  
 
  

  

  

 
context.xml
 
 
  

 
Thanks in Advance,
 
Scott Pippin


RE: logging question

2004-11-15 Thread Shapira, Yoav

Hi,
Just adding a Logger is not enough to redirect System.out.println calls
to it.  You need to add swallowOutput="true" to your Context definition.
Or alternatively change the code from using System.out.println to using
getServletContext().log(...).

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Scott Pippin [mailto:[EMAIL PROTECTED]
>Sent: Monday, November 15, 2004 10:20 AM
>To: [EMAIL PROTECTED]
>Subject: logging question
>
>I am trying to send the return values/errors for an application to a
>different stdout file.  I set up everything but stdout is being
>written
>to catalina.out.
>
>server.xml
>
> 
>   className="org.apache.catalina.mbeans.ServerLifecycleListener"
>debug="0"
>/>
>   className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
>debug="0" />
>   />
>   type="org.apache.catalina.UserDatabase" description="User database
>that
>can be updated and saved" />
>  
>   
>   factory
>   org.apache.catalina.users.MemoryUserDatabaseFactory
>   
>   
>   pathname
>   conf/tomcat-users.xml
>   
>   
>   
>  
>maxSpareThreads="75" enableLookups="false" redirectPort="8443"
>acceptCount="100" debug="0" connectionTimeout="2"
>disableUploadTimeout="true" />
>debug="0" protocol="AJP/1.3" />
> 
> prefix="catalina_log." suffix=".txt" timestamp="true" />
>  connectionName="ims" connectionPassword="ims"
>connectionURL="jdbc:mysql://10.131.1.200:3306/ims"
>driverName="com.mysql.jdbc.Driver" userTable="imsuser"
>userNameCol="userid" userCredCol="passwordid" userRoleTable="imsrole"
>roleNameCol="userrole" />
>  unpackWARs="true" autoDeploy="true" xmlValidation="false"
>xmlNamespaceAware="false">
> directory="logs"  prefix="localhost_log."
>suffix=".txt"
>timestamp="true"/>
>   
> 
>   
>  
>
>context.xml under the application/web-INF directory
>
>
>   prefix="ims_log." suffix=".txt" timestamp="true" verbosity="4" />
>   prefix="ims_err." suffix=".txt" timestamp="true" verbosity="4" />
>   prefix="ims_out." suffix=".txt" timestamp="true" verbosity="4" />
>
>
>Tomcat 5.0.28/Apache2
>
>Have I missed something?
>
>Thanks,
>
>Scott Pippin
>[EMAIL PROTECTED]



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


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



logging question

2004-11-15 Thread Scott Pippin
I am trying to send the return values/errors for an application to a
different stdout file.  I set up everything but stdout is being
written
to catalina.out.
 
server.xml
 
 




  
   
   factory 
   org.apache.catalina.users.MemoryUserDatabaseFactory 
   
   
   pathname 
   conf/tomcat-users.xml 
   
   
   
  
 
 
 
  
   
  
   
   
 
   
  
 
context.xml under the application/web-INF directory


   
   
   

 
Tomcat 5.0.28/Apache2
 
Have I missed something?
 
Thanks,

Scott Pippin
[EMAIL PROTECTED]


Windows XP, TC 4.1.29 and logging question (catalina.out)...

2004-02-12 Thread Timothy Stone
List,

I must be too close to the problem, having a background in managing 
Tomcat on Linux, I can't seem to figure out what is so drastically 
different about Tomcat on Windows that logging doesn't behave the same.

Specifically:

c:\%tomcat_home%\bin\startup.bat

runs in a separate window (expected) but only the following logs are 
being generated:

localhost_examples*
localhost_admin*
localhost_log*
'catalina* is conspicuously missing. However, the Logger is defined in 
the server.xml file! There is some standard out logging going on, but 
not to a file.

What directive am I missing? The archives didn't seem to answer my 
question directly. The server.xml file seems to implied that the global 
logger could be overridden, but I have not explictly stated any such 
overriding the server.xml is "out-of-the-box."

Many thanks in advance.
Tim
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: basic logging question

2003-06-20 Thread Mike Curwen
Do you have the log4j.jar file anywhere?  It would be difficult to do
log4j logging with out it in Tomcat's common/lib
 
Here is a basic configuration file I use, placed under my webapp's
WEB-INF/classes:

#log4j.properties
log4j.rootCategory=DEBUG, filer, chainsaw

log4j.appender.filer=org.apache.log4j.FileAppender
log4j.appender.filer.File=c:/webapps/IDM/WEB-INF/logs/output.log
# Control the maximum log file size
# log4j.appender.filer.MaxFileSize=100KB
# Archive log files (one backup file here)
# log4j.appender.filer.MaxBackupIndex=1
log4j.appender.filer.layout=org.apache.log4j.PatternLayout
log4j.appender.filer.layout.ConversionPattern=%-5p [%t] %c.%M() - %m
(%rms)%n


log4j.appender.chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.chainsaw.RemoteHost=localhost
log4j.appender.chainsaw.Port=4445
log4j.appender.chainsaw.LocationInfo=true

#log4j.appender.dest1=org.apache.log4j.ConsoleAppender
#log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
#log4j.appender.dest1.layout.ConversionPattern=%-5p [%t] %c - %m (%rms)


 

Note the fully qualified path here:
c:/webapps/IDM/WEB-INF/logs/output.log
 
That should change for your file to an appropriate value, and I'm fairly
certain this file should exist already (seems to me I had to create this
file before log4j would write to it)
 
If anyone can show me how to set this as a 'runtime' property (ie: from
a servlet context, determine the 'real path' to the WEB-INF/logs
directory  AND set it in log4j programmaticaly) I'd be much obliged.



> -Original Message-
> From: a b [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 20, 2003 3:15 PM
> To: [EMAIL PROTECTED]
> Subject: basic logging question
> 
> 
> Hello every one,
> I need to log messages using either tomcat logger or log4j. I 
> have added  className="org.apache.catalina.logger.FileLogger" 
> verbosity="1" prefix="localhost_gnomon_log." suffix=".txt" 
> timestamp="true"/> under the  tag and 
> System.out.println("msg"); works and prints in the above 
> named file, but i want to use 
> the methods of org.apache.catalina.logger.FileLogger or 
> log4j's Logger class so that i can turn logging on and off 
> and can use various levels like debug,info,warn,errors etc. I 
> tried to import org.apache.catalina.logger.FileLogger in java 
> servlet, but it says class not found. I do have 
> commons-logging under /common/lib folder. Please 
> guide me where am i going wrong? also if anyone who has log4j 
> under tomcat, i would appreciate their guidance in setting 
> log4j. i did create a example.cf file which created 
> configuration information for log4j and placed it under 
> WEB-INF/classes folder, but log4j does not picks the 
> configuration. Any ideas would be welcomed. Thanks
>  
> 
> 
> -
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> 


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



RE: basic logging question

2003-06-20 Thread Shapira, Yoav

Howdy,

>the methods of org.apache.catalina.logger.FileLogger or log4j's Logger
>class so that i can turn logging on and off and can use various levels
like
>debug,info,warn,errors etc. I tried to import
>org.apache.catalina.logger.FileLogger in java servlet, but it says
class
>not found. I do have commons-logging under /common/lib
folder.
>Please guide me where am i going wrong? also if anyone who has log4j
under

Don't use tomcat's internal Logger facilities, as they are
container-specific.  Instead, choose between using log4j by yourself or
using the commons-logging that's included with tomcat.

If you want to use commons-logging, in your servlet:

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Declare a private static Log:
private static Log theLog;

Then in the init() method of your servlet, or in static initialization:
theLog = LogFactory.getLog(getClass());

Now you can use it.  For more details, read the commons-logging
documentation.

If you want to use log4j directly, the code is fairly similar to the
above, except you don't need a LogFactory, you just have
org.apache.log4j.Logger and its getLogger(...) call.

You will need to configure log4j (read its docs for how to do this) or
commons-logging (read its docs for how to do this) if you find tomcat's
default configuration insufficient (as you likely will).

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]



basic logging question

2003-06-20 Thread a b
Hello every one,
I need to log messages using either tomcat logger or log4j. I have added
 under the  
tag and System.out.println("msg"); works and prints in the above named file, but i 
want to use 
the methods of org.apache.catalina.logger.FileLogger or log4j's Logger class so that i 
can turn logging on and off and can use various levels like debug,info,warn,errors 
etc. I tried to import org.apache.catalina.logger.FileLogger in java servlet, but it 
says class not found. I do have commons-logging under /common/lib folder. 
Please guide me where am i going wrong? also if anyone who has log4j under tomcat, i 
would appreciate their guidance in setting log4j. i did create a example.cf file which 
created configuration information for log4j and placed it under WEB-INF/classes 
folder, but log4j does not picks the configuration. Any ideas would be welcomed.
Thanks
 


-
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

RE: Logging Question

2003-04-02 Thread Jan Behrens
Howdy,

> >server logs all those messages to TOMCAT_HOME\logs\stderr.log -
>
> Really?  Not to $CATALINA_HOME/logs/catalina.out?

yes, really :)

>
> >unfortunately I can't persuaded the remote Tomcat to do same, although
> both
>
> So what is the remote server doing?  I would assume it's writing logs on
> its own machine.  Do you want the remote server to write the logs across
> the network to your machine?

No, it fills the localhost_log.DATE.txt, localhost_admin_log.DATE.txt,
localhost_examples_log.DATE.txt and the catalina.out but of these contains
*my* messages. They are of course written in its own /log dir. I log onto that
machine via ssh and can therefore check the logs.

Regards

Jan


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



RE: Logging Question

2003-04-02 Thread Shapira, Yoav

Howdy,

>server logs all those messages to TOMCAT_HOME\logs\stderr.log -

Really?  Not to $CATALINA_HOME/logs/catalina.out?

>unfortunately I can't persuaded the remote Tomcat to do same, although
both

So what is the remote server doing?  I would assume it's writing logs on
its own machine.  Do you want the remote server to write the logs across
the network to your machine?

Yoav Shapira
Millennium ChemInformatics



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]



Logging Question

2003-04-02 Thread Jan Behrens
Hello List,

I have just setup a new Tomcat on a remote-machine do deploy my webApp onto. I
am using 4.1.24 LE on a Debian Linux with JDK 1.4.1. As I am still in the
development-process I log alot of messages via System.err to the standard
error-log. This works fine on my Tomcat here at home (4.1.24 on Win2k) as the
server logs all those messages to TOMCAT_HOME\logs\stderr.log - unfortunately
I can't persuaded the remote Tomcat to do same, although both use exactly the
same server.xml and web.xml files.

Can anyone give me a tip as to what I am doing wrong please.

Regards

Jan


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



repost of logging question

2002-07-24 Thread Peter Choe

i tried to look for documentation to see if tomcat has some logging similar 
to apache so i can see what pages on tomcat is being accessed.

my set up is apache webserver connected to tomcat3.2 by mod_jk on two 
separate freebsd machines. where i can find a log file of what pages are 
being accessed on tomcat?



Peter Choe


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