tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Purcell" <spurc...@vertisinc.com>
Subject RE: logs
Date Mon, 28 Apr 2003 21:18:36 GMT
Aaah, that makes sense. Thank you Steve. I can make this work.

Sincerely
Scott

-----Original Message-----
From: Steve Gums [mailto:sgums@voast.com]
Sent: Monday, April 28, 2003 4:15 PM
To: Tomcat Users List
Subject: RE: logs


Just put this into a .java file and make sure the .class file is in the
CLASSPATH so it is just like calling a normal java function... like so..

import java.io.*;
import java.util.*;

public class LoggerUtil {

   public static void write (String status,String msg) {

     FileWriter fout;
     try {
        fout = new FileWriter ("/tmp/java.log",true);
     }//try
     catch ( IOException ioe ) {
        //do exception handling if requested
        return;
     }//catch

     java.util.Date date = new java.util.Date();
     try {
        fout.write ("[" + date.toString() + "]" + status  +
                    ":" + msg + "\n");
        fout.close();
     }//try
     catch ( IOException ioe ) {
        //do exception handling if requested
     }//catch
     return;
   }//GlobalLog

}//end of class

I have two params in mine one is a status that I use for Class Names or what
ever, the other is the message I want to print.  But you can change it how
you want... you would just make sure you import this class to use it.
import GlobalLogger;





-----Original Message-----
From: Scott Purcell [mailto:spurcell@vertisinc.com]
Sent: Monday, April 28, 2003 3:05 PM
To: Tomcat Users List
Subject: RE: logs


Do I put this into my code, or in some config file? And if in code, where
does output go?

Thanks,
skp

-----Original Message-----
From: Steve Gums [mailto:sgums@voast.com]
Sent: Monday, April 28, 2003 4:04 PM
To: Tomcat Users List
Subject: RE: logs


This is most likely not the best approach but I created a global static
class that just sends comments to a log file.  So I can basically do the
following

GlobalLogger.write("Sytext to check for debugging");

It seems to work well for me.

Steve
-----Original Message-----
From: Scott Purcell [mailto:spurcell@vertisinc.com]
Sent: Monday, April 28, 2003 2:58 PM
To: tomcat-user@jakarta.apache.org
Subject: logs


Hello,

I have just finished installing Tomcat 4.1 as a service. And all is good
thanks for the good people of the list.

As I finished the install and got my service running, I noticed that I do
not have my [System.out] screen anymore. I found a log directory
[stdout.log, stderr.log, localhost_admin_log_date,
localhost_examples_log_date, localhost-log_date] but I do not see my
System.out.println() from some servlets I am running.

I am running under a context of /cybrary in which I added a <Context path
="/cybrary" docBase="cybrary" debug="0" reloadable="true" /> to the
server.xml file, but I don't think that messed anything up.

So does anyone know where I can find my system.out.println() output
messages?

Thanks,
Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message