Class w3c.jigsaw.http.CommonLogger
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.http.CommonLogger

java.lang.Object
   |
   +----w3c.jigsaw.http.Logger
           |
           +----w3c.jigsaw.http.CommonLogger

public class CommonLogger
extends Logger
implements PropertyMonitoring
The CommonLogger class implements the abstract Logger class. The resulting log will conform to the common log format).
See Also:
Logger

Variable Index

 o errlog
 o ERRLOGNAME_P
Name of the property indicating the error log file.
 o log
 o logdir
 o LOGNAME_P
Name of the property indicating the log file.
 o props
 o server
 o trace
 o TRACELOGNAME_P
Name of the property indicating the server trace file.

Method Index

 o errlog(Client, String)
Log an error on behalf of some client object in the error log.
 o errlog(String)
Log an error on behalf of the server object.
 o errlogmsg(String)
 o getFilename(String, String)
Get the name for the file indicated by the provided property.
 o initialize(httpd)
Initialize this logger for the given server.
 o log(Request, Reply, int, long)
Log normally a full handled request.
 o logmsg(String)
 o openErrorLogFile()
Open this logger error log file.
 o openLogFile()
Open this logger log file.
 o openTraceFile()
Open this logger trace file.
 o output(RandomAccessFile, String)
Output the given message to the given RandomAccessFile.
 o propertyChanged(String)
Property monitoring for the logger.
 o shutdown()
Shutdown this logger.
 o trace(Client, String)
Log a client trace.
 o trace(String)
Log a server trace.
 o tracemsg(String)

Variables

 o LOGNAME_P
  public final static String LOGNAME_P
Name of the property indicating the log file. This property indicates the name of the log file to use.

This property defaults to the log file in the server log directory.

 o ERRLOGNAME_P
  public final static String ERRLOGNAME_P
Name of the property indicating the error log file. This property indicates the name of the error log file to use.

This property defaults to the errlog file in the server log directory.

 o TRACELOGNAME_P
  public final static String TRACELOGNAME_P
Name of the property indicating the server trace file. This property indicates the name of the trace file to use.

This property defaults to the trace file in the server log directory.

 o log
  protected RandomAccessFile log
 o errlog
  protected RandomAccessFile errlog
 o trace
  protected RandomAccessFile trace
 o server
  protected httpd server
 o props
  protected httpdProperties props
 o logdir
  protected String logdir

Methods

 o propertyChanged
  public boolean propertyChanged(String name)
Property monitoring for the logger. The logger allows you to dynamically (typically through the property setter) change the names of the file to which it logs error, access and traces.
Parameters:
name - The name of the property that has changed.
Returns:
A boolean, true if the change was made, false otherwise.
 o output
  protected synchronized void output(RandomAccessFile f,
                                     String msg) throws IOException
Output the given message to the given RandomAccessFile. This method makes its best effort to avoid one byte writes (which you get when writing the string as a whole). It first copies the string bytes into a private byte array, and than, write them all at once.
Parameters:
f - The RandomAccessFile to write to, which should be one of log, errlog or trace.
msg - The message to be written.
Throws: IOException
If writing to the output failed.
 o logmsg
  protected void logmsg(String msg)
 o errlogmsg
  protected synchronized void errlogmsg(String msg)
 o tracemsg
  protected synchronized void tracemsg(String msg)
 o log
  public void log(Request request,
                  Reply reply,
                  int nbytes,
                  long duration)
Log normally a full handled request.
Overrides:
log in class Logger
 o errlog
  public void errlog(Client client,
                     String msg)
Log an error on behalf of some client object in the error log.
Overrides:
errlog in class Logger
 o errlog
  public void errlog(String msg)
Log an error on behalf of the server object.
Overrides:
errlog in class Logger
 o trace
  public void trace(Client client,
                    String msg)
Log a client trace.
Overrides:
trace in class Logger
 o trace
  public void trace(String msg)
Log a server trace.
Overrides:
trace in class Logger
 o getFilename
  protected String getFilename(String propname,
                               String def)
Get the name for the file indicated by the provided property. This method first looks for a property value. If none is found, it than constructs a default filename from the server root, by using the provided default name.

This method shall either succeed in getting a filename, or throw a runtime exception.

Parameters:
propname - The name of the property.
def - The default file name to use.
Throws: HTTPRuntimeException
If no file name could be deduced from the provided set of properties.
 o openLogFile
  protected void openLogFile()
Open this logger log file.
 o openErrorLogFile
  protected void openErrorLogFile()
Open this logger error log file.
 o openTraceFile
  protected void openTraceFile()
Open this logger trace file.
 o shutdown
  public synchronized void shutdown()
Shutdown this logger.
Overrides:
shutdown in class Logger
 o initialize
  public void initialize(httpd server)
Initialize this logger for the given server. This method gets the server properties describe above to initialize its various log files.
Parameters:
server - The server to which thiss logger should initialize.
Overrides:
initialize in class Logger

All Packages  Class Hierarchy  This Package  Previous  Next  Index