Xoops\Core\Logger - dispatch log requests to any registered loggers.
No logging is done in this class, but any logger, implemented as a
module or extension, can register as a logger using the addLogger()
method. Multiple loggers can be registered, and each will be
invoked in turn for each log() call.
Such loggers are expected to implement the PSR-3 LoggerInterface.
In addition, any logger that generates output as part of the XOOPS
delivered page should implement the quiet() method, to disable output.
Loggers are managed this way so that any routine may easily add a
log entry without needing to know any details of the implementation.
Not all events are published through this mechanism, only specific requests
to log() or related methods. Individual loggers may listen for events (i.e.
preloads) or other sources and gain access to detailed debugging information.
Methods summary
public static
Xoops\Core\Logger
|
#
getInstance( )
Get the Xoops\Core\Logger instance
Get the Xoops\Core\Logger instance
Returns
|
public
|
#
handleError( integer $errorNumber, string $errorString, string $errorFile, integer $errorLine )
Error handling callback.
This will
Parameters
- $errorNumber
- error number
- $errorString
- error message
- $errorFile
- file
- $errorLine
- line number
|
public
|
#
handleException( Exception|Throwable $e )
Exception handling callback.
Exception handling callback.
This will
Parameters
- $e
- uncaught Exception or Error
|
public
string
|
#
sanitizePath( string $message )
clean a path to remove sensitive details
clean a path to remove sensitive details
Parameters
- $message
- text to sanitize
Returns
string sanitized message
|
public
|
#
addLogger( object $logger )
add a PSR-3 compatible logger to the chain
add a PSR-3 compatible logger to the chain
Parameters
- $logger
- a PSR-3 compatible logger object
|
public
|
#
emergency( string $message, array $context = array() )
System is unusable.
Parameters
- $message
- message
- $context
- array of context data for this log entry
|
public
|
#
alert( string $message, array $context = array() )
Action must be taken immediately.
Action must be taken immediately.
Example: Entire website down, database unavailable, etc. This should
trigger the SMS alerts and wake you up.
Parameters
- $message
- message
- $context
- array of context data for this log entry
|
public
|
#
critical( string $message, array $context = array() )
Critical conditions.
Example: Application component unavailable, unexpected exception.
Parameters
- $message
- message
- $context
- array of context data for this log entry
|
public
|
#
error( string $message, array $context = array() )
Runtime errors that do not require immediate action but should typically
be logged and monitored.
Runtime errors that do not require immediate action but should typically
be logged and monitored.
Parameters
- $message
- message
- $context
- array of context data for this log entry
|
public
|
#
warning( string $message, array $context = array() )
Exceptional occurrences that are not errors.
Exceptional occurrences that are not errors.
Example: Use of deprecated APIs, poor use of an API, undesirable things
that are not necessarily wrong.
Parameters
- $message
- message
- $context
- array of context data for this log entry
|
public
|
#
notice( string $message, array $context = array() )
Normal but significant events.
Normal but significant events.
Parameters
- $message
- message
- $context
- array of context data for this log entry
|
public
|
#
info( string $message, array $context = array() )
Interesting events.
Example: User logs in, SQL logs.
Parameters
- $message
- message
- $context
- array of context data for this log entry
|
public
|
#
debug( string $message, array $context = array() )
Detailed debug information.
Detailed debug information.
Parameters
- $message
- message
- $context
- array of context data for this log entry
|
public
|
#
log( mixed $level, string $message, array $context = array() )
Logs with an arbitrary level.
Logs with an arbitrary level.
Parameters
- $level
- PSR-3 LogLevel constant
- $message
- message
- $context
- array of context data for this log entry
|
public
|
#
quiet( )
quiet - turn off output if output is rendered in XOOPS page output.
This is intended to assist ajax code that may fail with any extra
content the logger may introduce.
quiet - turn off output if output is rendered in XOOPS page output.
This is intended to assist ajax code that may fail with any extra
content the logger may introduce.
It should have no effect on loggers using other methods, such a write
to file.
|
public
|
#
__set( string $var, string $val )
Keep deprecated calls from failing
Keep deprecated calls from failing
Deprecated
Parameters
|
public
|
#
__get( string $var )
Keep deprecated calls from failing
Keep deprecated calls from failing
Deprecated
Parameters
|
public
|
#
__call( string $method, string $args )
Keep deprecated calls from failing
Keep deprecated calls from failing
Deprecated
Parameters
- $method
- method
- $args
- arguments
|