Methods summary
public
|
#
__construct( string $name )
Constructor.
Parameters
- $name
string $name Name of the logger.
|
public
string
|
#
getName( )
Returns the logger name.
Returns
string
|
public
Logger
|
#
getParent( )
Returns the parent Logger. Can be null if this is the root logger.
Returns the parent Logger. Can be null if this is the root logger.
Returns
|
public
|
#
trace( mixed $message, Exception $throwable = null )
Log a message object with the TRACE level.
Log a message object with the TRACE level.
Parameters
- $message
mixed $message message
- $throwable
Exception $throwable Optional throwable information to include in the logging event.
|
public
|
#
debug( mixed $message, Exception $throwable = null )
Log a message object with the DEBUG level.
Log a message object with the DEBUG level.
Parameters
- $message
mixed $message message
- $throwable
Exception $throwable Optional throwable information to include in the logging event.
|
public
|
#
info( mixed $message, Exception $throwable = null )
Log a message object with the INFO Level.
Log a message object with the INFO Level.
Parameters
- $message
mixed $message message
- $throwable
Exception $throwable Optional throwable information to include in the logging event.
|
public
|
#
warn( mixed $message, Exception $throwable = null )
Log a message with the WARN level.
Log a message with the WARN level.
Parameters
- $message
mixed $message message
- $throwable
Exception $throwable Optional throwable information to include in the logging event.
|
public
|
#
error( mixed $message, Exception $throwable = null )
Log a message object with the ERROR level.
Log a message object with the ERROR level.
Parameters
- $message
mixed $message message
- $throwable
Exception $throwable Optional throwable information to include in the logging event.
|
public
|
#
fatal( mixed $message, Exception $throwable = null )
Log a message object with the FATAL level.
Log a message object with the FATAL level.
Parameters
- $message
mixed $message message
- $throwable
Exception $throwable Optional throwable information to include in the logging event.
|
public
|
#
log( LoggerLevel $level, mixed $message, Exception $throwable = null )
Log a message using the provided logging level.
Log a message using the provided logging level.
Parameters
- $level
LoggerLevel
$level The logging level.
- $message
mixed $message Message to log.
- $throwable
Exception $throwable Optional throwable information to include in the logging event.
|
public
|
#
logEvent( LoggerLoggingEvent $event )
Logs an already prepared logging event object.
Logs an already prepared logging event object.
Parameters
|
public
|
#
assertLog( boolean $assertion = true, string $msg = '' )
If assertion parameter evaluates as false, then logs the message using the
ERROR level.
If assertion parameter evaluates as false, then logs the message using the
ERROR level.
Parameters
- $assertion
boolean $assertion
- $msg
string $msg message to log
|
public
|
#
forcedLog( string $fqcn, Exception $throwable, LoggerLevel $level, mixed $message )
This method creates a new logging event and logs the event without further
checks.
|
public
|
#
callAppenders( LoggerLoggingEvent $event )
Forwards the given logging event to all linked appenders.
Forwards the given logging event to all linked appenders.
Parameters
|
public
boolean
|
#
isEnabledFor( LoggerLevel $level )
Check whether this Logger is enabled for a given Level passed as
parameter.
Check whether this Logger is enabled for a given Level passed as
parameter.
Parameters
Returns
boolean
|
public
boolean
|
#
isTraceEnabled( )
Check whether this Logger is enabled for the TRACE Level.
Check whether this Logger is enabled for the TRACE Level.
Returns
boolean
|
public
boolean
|
#
isDebugEnabled( )
Check whether this Logger is enabled for the DEBUG Level.
Check whether this Logger is enabled for the DEBUG Level.
Returns
boolean
|
public
boolean
|
#
isInfoEnabled( )
Check whether this Logger is enabled for the INFO Level.
Check whether this Logger is enabled for the INFO Level.
Returns
boolean
|
public
boolean
|
#
isWarnEnabled( )
Check whether this Logger is enabled for the WARN Level.
Check whether this Logger is enabled for the WARN Level.
Returns
boolean
|
public
boolean
|
#
isErrorEnabled( )
Check whether this Logger is enabled for the ERROR Level.
Check whether this Logger is enabled for the ERROR Level.
Returns
boolean
|
public
boolean
|
#
isFatalEnabled( )
Check whether this Logger is enabled for the FATAL Level.
Check whether this Logger is enabled for the FATAL Level.
Returns
boolean
|
public
|
|
public
|
#
removeAllAppenders( )
Removes all appenders from the Logger.
Removes all appenders from the Logger.
|
public
|
#
removeAppender( mixed $appender )
Remove the appender passed as parameter form the Logger.
Remove the appender passed as parameter form the Logger.
Parameters
- $appender
mixed $appender an appender name or a LoggerAppender instance.
|
public
array
|
#
getAllAppenders( )
Returns the appenders linked to this logger as an array.
Returns the appenders linked to this logger as an array.
Returns
array collection of appender names
|
public
LoggerAppender
|
#
getAppender( mixed $name )
Returns a linked appender by name.
Returns a linked appender by name.
Returns
|
public
|
#
setAdditivity( boolean $additive )
Sets the additivity flag.
Sets the additivity flag.
Parameters
- $additive
boolean $additive
|
public
boolean
|
#
getAdditivity( )
Returns the additivity flag.
Returns the additivity flag.
Returns
boolean
|
public
LoggerLevel
|
#
getEffectiveLevel( )
Starting from this Logger, search the Logger hierarchy for a non-null level
and return it.
Starting from this Logger, search the Logger hierarchy for a non-null level
and return it.
Returns
See
|
public
LoggerLevel
|
#
getLevel( )
Get the assigned Logger level.
Get the assigned Logger level.
Returns
LoggerLevel
The assigned level or null if none is assigned.
|
public
|
#
setLevel( LoggerLevel $level = null )
Set the Logger level.
Use LoggerLevel::getLevelXXX() methods to get a LoggerLevel object, e.g.
<span
class="php-var">$logger</span>->setLevel(LoggerLevel::getLevelInfo());
Parameters
- $level
LoggerLevel
$level The level to set, or NULL to clear the logger level.
|
public
boolean
|
#
isAttached( LoggerAppender $appender )
Checks whether an appender is attached to this logger instance.
Checks whether an appender is attached to this logger instance.
Parameters
Returns
boolean
|
public
|
|
public static
LoggerHierarchy
|
#
getHierarchy( )
Returns the hierarchy used by this Logger.
Returns the hierarchy used by this Logger.
Caution: do not use this hierarchy unless you have called initialize(). To
get Loggers, use the Logger::getLogger and Logger::getRootLogger methods instead
of operating on on the hierarchy directly.
Returns
|
public static
Logger
|
#
getLogger( string $name )
Returns a Logger by name. If it does not exist, it will be created.
Returns a Logger by name. If it does not exist, it will be created.
Parameters
- $name
string $name The logger name
Returns
|
public static
LoggerRoot
|
|
public static
boolean
|
#
clear( )
Clears all Logger definitions from the logger hierarchy.
Clears all Logger definitions from the logger hierarchy.
Returns
boolean
|
public static
|
#
resetConfiguration( )
Destroy configurations for logger definitions
Destroy configurations for logger definitions
|
public static
boolean
|
#
exists( string $name )
check if a given logger exists.
check if a given logger exists.
Parameters
- $name
string $name logger name
Returns
boolean
|
public static
array
|
#
getCurrentLoggers( )
Returns an array this whole Logger instances.
Returns an array this whole Logger instances.
Returns
array
See
|
public static
|
#
configure( string|array $configuration = null, string|LoggerConfigurator $configurator = null )
Configures log4php.
This method needs to be called before the first logging event has occured. If
this method is not called before then the default configuration will be
used.
Parameters
- $configuration
string|array $configuration Either a path to the configuration file, or a configuration
array.
- $configurator
string|LoggerConfigurator $configurator A custom configurator class: either a class name (string), or an
object which implements the LoggerConfigurator interface. If left empty, the
default configurator implementation will be used.
|