PHP Class Scalr\Logger

Since: 5.0 (19.09.2014)
Author: Vitaliy Demidov ([email protected])
Show file Open project: scalr/scalr

Protected Properties

Property Type Description
$dateFormat string Nov 13 06:28:01 -06:00
$level integer Retport level
$logLevelName array Log level names
$name string Category name
$severities array Helps to convert a level into integer representation for writing into DB

Public Methods

Method Description
__construct ( string $name = '' ) Constructor
debug ( string $message, string $args = null ) Log a message with the DEBUG level.
error ( string $message, string $args = null ) Log a message with the ERROR level.
fatal ( string $message, string $args = null ) Log a message with the FATAL level.
getDateFormat ( ) : string Gets the format of the date
getLevel ( ) : integer Gets log level
getName ( ) : string Gets the name of a logger category
info ( string $message, string $args = null ) Log a message with the INFO level.
log ( integer | string $level, string $message, string $args = null ) Raw log message
setDateFormat ( string $dateFormat ) : Logger Sets the format of the date
setLevel ( integer | string $logLevel ) : Logger Sets log level
setName ( string $name ) : Logger Sets the name of a logger category
warn ( string $message, string $args = null ) Log a message with the WARN level.

Method Details

__construct() public method

Constructor
public __construct ( string $name = '' )
$name string optional The name of the category

debug() public method

Log a message with the DEBUG level.
public debug ( string $message, string $args = null )
$message string The message that accepts format
$args string optional An arguments

error() public method

Log a message with the ERROR level.
public error ( string $message, string $args = null )
$message string The message that accepts format
$args string optional An arguments

fatal() public method

Log a message with the FATAL level.
public fatal ( string $message, string $args = null )
$message string The message that accepts format
$args string optional An arguments

getDateFormat() public method

Gets the format of the date
public getDateFormat ( ) : string
return string Returns the format of the date

getLevel() public method

Gets log level
public getLevel ( ) : integer
return integer Returns log level

getName() public method

Gets the name of a logger category
public getName ( ) : string
return string Returns the name of a logger category

info() public method

Log a message with the INFO level.
public info ( string $message, string $args = null )
$message string The message that accepts format
$args string optional An arguments

log() public method

Raw log message
public log ( integer | string $level, string $message, string $args = null )
$level integer | string The log level
$message string The message that accepts format specification
$args string optional An arguments

setDateFormat() public method

Sets the format of the date
public setDateFormat ( string $dateFormat ) : Logger
$dateFormat string The format of the date
return Logger

setLevel() public method

Sets log level
public setLevel ( integer | string $logLevel ) : Logger
$logLevel integer | string A log level also accepts (FATAL, ERROR, WARN, INFO, DEBUG)
return Logger

setName() public method

Sets the name of a logger category
public setName ( string $name ) : Logger
$name string The name of the category or class
return Logger

warn() public method

Log a message with the WARN level.
public warn ( string $message, string $args = null )
$message string The message that accepts format
$args string optional An arguments

Property Details

$dateFormat protected property

Nov 13 06:28:01 -06:00
protected string $dateFormat
return string

$level protected property

Retport level
protected int $level
return integer

$logLevelName protected static property

Log level names
protected static array $logLevelName
return array

$name protected property

Category name
protected string $name
return string

$severities protected static property

Helps to convert a level into integer representation for writing into DB
protected static array $severities
return array