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
-
errlog
-
-
ERRLOGNAME_P
- Name of the property indicating the error log file.
-
log
-
-
logdir
-
-
LOGNAME_P
- Name of the property indicating the log file.
-
props
-
-
server
-
-
trace
-
-
TRACELOGNAME_P
- Name of the property indicating the server trace file.
-
errlog(Client, String)
- Log an error on behalf of some client object in the error log.
-
errlog(String)
- Log an error on behalf of the server object.
-
errlogmsg(String)
-
-
getFilename(String, String)
- Get the name for the file indicated by the provided property.
-
initialize(httpd)
- Initialize this logger for the given server.
-
log(Request, Reply, int, long)
- Log normally a full handled request.
-
logmsg(String)
-
-
openErrorLogFile()
- Open this logger error log file.
-
openLogFile()
- Open this logger log file.
-
openTraceFile()
- Open this logger trace file.
-
output(RandomAccessFile, String)
- Output the given message to the given RandomAccessFile.
-
propertyChanged(String)
- Property monitoring for the logger.
-
shutdown()
- Shutdown this logger.
-
trace(Client, String)
- Log a client trace.
-
trace(String)
- Log a server trace.
-
tracemsg(String)
-
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.
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.
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.
log
protected RandomAccessFile log
errlog
protected RandomAccessFile errlog
trace
protected RandomAccessFile trace
server
protected httpd server
props
protected httpdProperties props
logdir
protected String logdir
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.
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.
logmsg
protected void logmsg(String msg)
errlogmsg
protected synchronized void errlogmsg(String msg)
tracemsg
protected synchronized void tracemsg(String msg)
log
public void log(Request request,
Reply reply,
int nbytes,
long duration)
- Log normally a full handled request.
- Overrides:
- log in class Logger
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
errlog
public void errlog(String msg)
- Log an error on behalf of the server object.
- Overrides:
- errlog in class Logger
trace
public void trace(Client client,
String msg)
- Log a client trace.
- Overrides:
- trace in class Logger
trace
public void trace(String msg)
- Log a server trace.
- Overrides:
- trace in class Logger
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.
openLogFile
protected void openLogFile()
- Open this logger log file.
openErrorLogFile
protected void openErrorLogFile()
- Open this logger error log file.
openTraceFile
protected void openTraceFile()
- Open this logger trace file.
shutdown
public synchronized void shutdown()
- Shutdown this logger.
- Overrides:
- shutdown in class Logger
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