Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: Customizing Logger file names

Francois JEANMOUGIN

2003-10-17


> >Yes, but modifying org.apache.catalina.logger.FileLogger is clearly a
> >tomcat developer concept :). Of course, if I could, I would. I
> remember
> a
>
> Not for this list, it's not. Many tomcat users modify/extend/create
> their own Loggers, Valve, Manager, and other tomcat plug-ins.

Okay, here I am, my first Java lines. I downloaded tomcat 4.1.27 sources and perform the following in :
src/share/org/apache/catalina/logger/FileLogger.java

Added a line

import java.lang.String;

In the import part of the file, Added :

private String localhostname = "";

to define the string near the suffix String declaration.

Then, I fetch the local host name like this :

  public String getLocalHostName() {

    return (localhostname);

  }
As far as I understood it, it should return a string containing the local hostname.

And then, I modified that :

    try {
       String pathname = dir.getAbsolutePath() + File.separator +
          prefix + date + localhostname + suffix;
       writer = new PrintWriter(new FileWriter(pathname, true), true);
    } catch (IOException e) {
       writer = null;
    }

And now, my friends[1]... I need to compile that class, but I can't find a way to make it aware about all the things it imports. I understood I can declare this class (using CLASSPATH) before the bootstrap and it will "overwrtite" or "surrender" the tomcat class. But, how can I buid it ?

Thank you for your help and sorry to bother you with possibly trivial Java questions.

François.


[1] We're going to the unknown... Perhaps to hell it's. It's a Spanish train...


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.