SUMMARY: CONSTR | METHOD DETAIL: CONSTR | METHOD

Class HTTP::Daemon::Threaded::Logable

Known Subclasses:
HTTP::Daemon::Threaded::WebClient
HTTP::Daemon::Threaded::Content
HTTP::Daemon::Threaded::Listener

Abstract base logger class for component classes. Provides an interface to the Event and Web Logger components which responds to the current LogLevel of the component. If the EventLogger component is not defined, then messages are logged to STDERR. If the WebLogger component is not defined, the messages are silently discarded.

Copyright© 2006, Dean Arnold, Presicient Corp., USA
All rights reserved.

Licensed under the Academic Free License version 2.1, as specified in the License.txt file included in this software package, or at OpenSource.org.

Author:
D. Arnold
Version:
0.90
Since:
2006-08-21

Unless otherwise noted, $self is the object instance variable.

Method Summary
getLogLevel()
          Returns the current log level
logError($msg)
          Log an error message
logInfo($msg, $level)
          Log an informational message
logRequest($addr, $status, $size)
          Log a web request
logTiming($msg)
          Log detail message timing traces
logWarning($msg)
          Log a warning message
scanForLogging($request)
          Collect web request log info
setLogLevel($level)
          Updates the current log level

Method Details

getLogLevel

getLogLevel()

Returns the current log level

Returns:
log level

logError

logError($msg)

Log an error message. Prefix the message with the error tag and the type of the object reporting the error

Parameters:
$msg - error message text
Returns:
undef

logInfo

logInfo($msg, $level)

Log an informational message. Prefix the message with the information tag and the type of the object reporting the error. Informational logs are only applied when the object's loglevel > 2, or greater than the specified minimum loglevel

Parameters:
$msg - information message text
$level - optional minimum log level at which to log the text
Returns:
$self

logRequest

logRequest($addr, $status, $size)

Log a web request. The previously stored HTTP request log fragments are combined with the client IP address, response timestamp, response status, and response size. The output format is the Apache Combined Log format.

Parameters:
$addr - client IP address
$status - response HTTP status code
$size - response size in bytes
Returns:
this object
See Also:
Apache Combined Log format

logTiming

logTiming($msg)

Log detail message timing traces. Only logs when the diagnostic message timing is enabled. No prefixes are required.

Parameters:
$msg - the message timing text
Returns:
the object

logWarning

logWarning($msg)

Log a warning message. Prefix the message with the warning tag and the type of the object reporting the error. Warnings are only logged when the object's loglevel > 1

Parameters:
$msg - warning message text
Returns:
this object

scanForLogging

scanForLogging($request)

Collect web request log info. The HTTP request line, user authorization, referer, and user agent are collected for later logging purposes. The collected information is stored in this Logable object for later use when the response is eventually sent back to the client. Note that this step is required in order to avoid altering the standard HTTP::Daemon::ClientConn send_XXX() interfaces overridden by HTTP::Daemon::Threaded::Socket to provide automatic web logging capability. Only performed if a WebLogger is configured.

Parameters:
$request - an HTTP::Request object
Returns:
this Logable object

setLogLevel

setLogLevel($level)

Updates the current log level

Parameters:
$level - new log level
Returns:
new log level

Generated by psichedoc on Mon Aug 28 09:45:39 2006