You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Leon Kwan <le...@icon.com.hk> on 2003/05/07 13:41:53 UTC

File logging in virutal host

Dear all,

    I would like to ask a question about the file logging in virtual 
host. As you can see in the section of the server.xml at the bottom of 
the mail. I have set several things:
Under virtual host of abc,
    org.apache.catalina.logger.FileLogger          logs/abc/ul_log.X.txt
    org.apache.catalina.logger.SystemErrLogger     logs/abc/ul_stderr.X.txt
    org.apache.catalina.logger.SystemOutLogger     logs/abc/ul_stdout.X.txt
    the access log                                 
logs/abc/ul_access_log.X.txt
Under this virtual host, there is a Root context with the logging
    org.apache.catalina.logger.FileLogger          
logs/abc/root/ul_log.X.txt
    org.apache.catalina.logger.SystemErrLogger     
logs/abc/root/ul_stderr.X.txt
    org.apache.catalina.logger.SystemOutLogger    
 logs/abc/root/ul_stdout.X.txt

However, I found that it cannot capture the std error and std out, 
neither under logs/abc or logs/abc/root. i.e. when I output some info in 
JSP of this virtual host to the stdout or stderr, I cannot find any file 
storing those info.  May I know is there anything go wrong?
Originally, I have set in the registry that the Tomcat service will 
write the stderr and stdout to a specific file. But now I have removed 
those 2 values in the registry and restart the service again and I am 
sure no these 2 files are created anymore.
My main purpose here is just to separate the std err and std out amongst 
each virtual host.

BTW, what is the difference between FileLogger and SystemOutLogger?
According to the manual:
    FileLogger: records all logged messages to disk file(s)
    SystemOutLogger: records all logged messages to whatever stream the 
standard output of Catalina is pointed at
what mean by disk file in FileLogger? I do not quite understand about it.

Here is the section of the server.xml:

<Host name="abc" debug="0" appBase="webapps/abc" unpackWARs="true" 
autoDeploy="true">
<!-- Logger shared by all Contexts related to this virtual host.  By
     default (when using FileLogger), log files are created in the "logs"
     directory relative to $CATALINA_HOME.  If you wish, you can specify
     a different directory with the "directory" attribute.  Specify either a
     relative (to $CATALINA_HOME) or absolute path to the desired
     directory.-->
    <Logger className="org.apache.catalina.logger.FileLogger" 
directory="logs/abc"  prefix="abc_log." suffix=".txt" timestamp="true"/>
    <Logger className="org.apache.catalina.logger.SystemErrLogger" 
directory="logs/abc" prefix="abc_stderr." suffix=".txt" timestamp="true"/>
    <Logger className="org.apache.catalina.logger.SystemOutLogger" 
directory="logs/abc" prefix="abc_stdout." suffix=".txt" timestamp="true"/>
    <Valve className="org.apache.catalina.valves.AccessLogValve" 
directory="logs/abc"  prefix="abc_access_log." suffix=".txt" 
pattern="common" resolveHosts="false"/>
    <Context path="" docBase="/" debug="0" reloadable="true" 
crossContext="true">
        <Logger className="org.apache.catalina.logger.SystemErrLogger" 
directory="logs/abc/root" prefix="abc_stderr." suffix=".txt" 
timestamp="true"/>
          <Logger className="org.apache.catalina.logger.SystemOutLogger" 
directory="logs/abc/root" prefix="abc_stdout." suffix=".txt" 
timestamp="true"/>
          <Logger className="org.apache.catalina.logger.FileLogger" 
directory="logs/abc/root" prefix="abc_log." suffix=".txt" timestamp="true"/>
    </Context>
    </Host>

-Thanks in advance
-Leon


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