Public Member Functions | |
constructor opts | |
close | |
open | |
write dest line | |
log request response | |
err error | |
tanzer::logger::constructor | opts | ||
Create a new logger. The following configuration options may be specified in $opts
as a list of key-value pairs:
accessLog
The path to a file to record incoming requests to. If this is not specified, then incoming requests will be logged to standard output.
errorLog
The path to a file to record internal server errors to. If this is not specified, then internal server errors will be logged to standard output.
logStackTraces
A boolean value, defaulting to 1
, indicating whether or not to log stack traces when handling error logs.
tanzer::logger::close |
Close all log files held by the current logger object.
tanzer::logger::err | error | ||
Record the specified $error
to the error log, appending any stack traces if logStackTraces
is set to 1
.
tanzer::logger::log | request response | ||
Record the incoming $request
and its $response
to the access log.
tanzer::logger::open |
Open all log files specified at logger construction time. If the log files are already opened, then they will be closed and reopened. This may be a useful thing if log files are rotated and need to be recreated.
tanzer::logger::write | dest line | ||
Write $line
to the logging destination $dest
(one of accessLog
or errorLog
), immediately flushing the output to disk.