| java.lang.Object org.w3c.jigsaw.http.Logger org.w3c.jigsaw.http.CommonLogger
All known Subclasses: org.w3c.jigsaw.http.ExtendedCommonLogger,
Constructor Summary | |
| CommonLogger() Construct a new Logger instance. |
Method Summary | |
protected synchronized void | appendLogBuffer(String msg) | protected synchronized void | checkLogFile(Date now) | protected synchronized void | dateCache(long date, StringBuffer sb) | public void | errlog(Client client, String msg) | public void | errlog(String msg) | protected void | errlogmsg(String msg) | 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. | public void | initialize(httpd server) Initialize this logger for the given server. | public void | log(Request request, Reply reply, int nbytes, long duration) Log the given HTTP transaction. | public void | log(String msg) | protected void | logmsg(String msg) | protected void | openErrorLogFile() Open this logger error log file. | protected void | openLogFile(int year, int month, int day) | protected void | openLogFile(int year, int month) | protected void | openLogFile(int year) | protected void | openLogFile() Open this logger log file. | protected void | openTraceFile() Open this logger trace file. | protected synchronized void | output(RandomAccessFile f, String msg) 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). | 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. | public synchronized void | shutdown() Shutdown this logger. | public synchronized void | sync() Save all pending data to stable storage. | public void | trace(Client client, String msg) | public void | trace(String msg) | protected void | tracemsg(String msg) |
BUFSIZE_P | final public static String BUFSIZE_P(Code) | | Name of the property indicating the buffer size for the logger.
This buffer size applies only the the log file, not to the error
log file, or the trace log file. It can be set to zero if you want
no buffering.
This property default to 4096.
|
ERRLOGNAME_P | final public static String ERRLOGNAME_P(Code) | | 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.
|
LOGDIRNAME_P | final public static String LOGDIRNAME_P(Code) | | 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.
|
LOGNAME_P | final public static String LOGNAME_P(Code) | | 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.
|
ROTATE_LEVEL_P | final public static String ROTATE_LEVEL_P(Code) | | Name of the property indicating the buffer size for the logger.
This buffer size applies only the the log file, not to the error
log file, or the trace log file. It can be set to zero if you want
no buffering.
This property default to 4096.
|
TRACELOGNAME_P | final public static String TRACELOGNAME_P(Code) | | Name of the property indicating the server log directory.
This property defaults to the logs directory in the
server main directory.
|
buffer | protected byte buffer(Code) | | |
bufptr | protected int bufptr(Code) | | |
bufsize | protected int bufsize(Code) | | |
month | protected int month(Code) | | |
rotateLevel | protected int rotateLevel(Code) | | |
CommonLogger | CommonLogger()(Code) | | Construct a new Logger instance.
|
checkLogFile | protected synchronized void checkLogFile(Date now)(Code) | | |
dateCache | protected synchronized void dateCache(long date, StringBuffer sb)(Code) | | It actually does multiple things, check when to rotate log files
and also dumps the formatted date string to a stringbuffer
it is dirty but hopefully faster than the previous version of the logger
|
getFilename | protected String getFilename(String propname, String def)(Code) | | 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. Parameters: def - The default file name to use. exception: HTTPRuntimeException - If no file name could be deduced fromthe provided set of properties. |
initialize | public void initialize(httpd server)(Code) | | 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. |
log | public void log(Request request, Reply reply, int nbytes, long duration)(Code) | | Log the given HTTP transaction.
This is shamelessly slow.
|
openErrorLogFile | protected void openErrorLogFile()(Code) | | Open this logger error log file.
|
openLogFile | protected void openLogFile(int year, int month, int day)(Code) | | |
openLogFile | protected void openLogFile(int year, int month)(Code) | | |
openLogFile | protected void openLogFile(int year)(Code) | | |
openLogFile | protected void openLogFile()(Code) | | Open this logger log file.
|
openTraceFile | protected void openTraceFile()(Code) | | Open this logger trace file.
|
output | protected synchronized void output(RandomAccessFile f, String msg) throws IOException(Code) | | 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 oflog, errlog or trace. Parameters: msg - The message to be written. exception: IOException - If writing to the output failed. |
propertyChanged | public boolean propertyChanged(String name)(Code) | | 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. A boolean, true if the change was made, false otherwise. |
shutdown | public synchronized void shutdown()(Code) | | Shutdown this logger.
|
sync | public synchronized void sync()(Code) | | Save all pending data to stable storage.
|
|
|