Class Log
- Psr\Log\LogLevel
AloFramework\Log\LogimplementsPsr\Log\LoggerInterfaceusesPsr\Log\LoggerTrait
Methods summary
public | #__construct(string$logLevel=Psr\Log\LogLevel::DEBUG,string$label= ALO_LOG_LABEL,string$savePath= ALO_LOG_SAVE_PATH)Constructor Parameters- $logLevel
string $logLevel Minimum log level to log. See class constants.- $label
string $label Log label, e.g. if you specify 'System' log entries will be prepended with SYSTEM- $savePath
string $savePath The file to save the logs in. If omitted, the logs directory in this package will be used with the filenames being today's date in YYYY-mm-dd format.
ThrowsAuthor |
public string | #__toString( )Returns a string representation of the class Returns a string representation of the class Returnsstring
Author |
publicAloFramework\Log\Log|string | #savePath(string|null$path=null)Gets or sets the log file path Gets or sets the log file path Parameters- $path
string|null $path Omit if using as a getter; The path to the log file otherwise
ReturnsThrowsAuthor |
publicAloFramework\Log\Log|string | #logLabel(string|null$set=null)Gets or sets the log label Gets or sets the log label Parameters- $set
string|null $set Omit if using as a getter, the new log label if using as a setter.
ReturnsThrowsAuthor |
publicAloFramework\Log\Log|string | #level(string|null$set=null)Gets or sets the log level Gets or sets the log level Parameters- $set
string|null $set Omit if using as a getter, the log level if using as a setter - see class constants or refer to the PSR-3 standards.
ReturnsThrowsAuthor |
public boolean | #log(string$level,string$message,array$context= [])Logs with an arbitrary level. Logs with an arbitrary level. Parameters- $level
string $level The message's log level- $message
string $message The message- $context
array $context The message context/placeholder asociative array
Returnsboolean Whether the message has been written
ThrowsImplementation of |
private boolean | #doWrite(string$level,string$message)Performs the actual log operation Performs the actual log operation Parameters- $level
string $level Log level- $message
string $message Raw message
Returnsboolean
Author |
protected static string | #replaceContext(string$message,array$context= [])Replaces the placeholders in the message Replaces the placeholders in the message Parameters- $message
string $message The raw message- $context
array $context The context/placeholder assoc array
Returnsstring
|
alert(),critical(),debug(),emergency(),error(),info(),notice(),warning()
alert(),critical(),debug(),emergency(),error(),info(),notice(),warning()
Magic methods summary
Constants summary
ALERT,CRITICAL,DEBUG,EMERGENCY,ERROR,INFO,NOTICE,WARNING
Properties summary
protected string | $label | |
protected string | $savePath | #Where the logs are stored Where the logs are stored |
protected string | $level | |
private static string | $SEPARATOR | |
private static array | $priority | #Log levels and their priorities Log levels and their priorities |