Log
namespace |
bhenk\logger\log |
predicates |
Cloneable | Instantiable |
known subclasses |
Default log agent
The type of Logger used by this log agent defaults to “log” and has a two logfiles, one for all statements. Log messages exceeding a certain level will also be logged to an error logfile.
Documentation of logging calls copied from https://www.php-fig.org/psr/psr-3/.
Methods
Log::getType
predicates |
public | static |
Get the type of logger used by this log agent
public static function getType(): LoggerTypes
Log::setType
predicates |
public | static |
Set the type of logger used by this log agent
public static function setType(
Parameter #0 [ <required> bhenk\logger\build\LoggerTypes $type ]
): LoggerTypes
Log::setLevel
predicates |
public | static |
Set the level at which the handlers of this log agents logger will fire
Warning: do not use this method for logging configuration. Use a logger definition file instead.
Caveat: this method will only have effect on implementations of logger that expose the method getHandlers() and only on handlers that expose the method setLevel().
public static function setLevel(
Parameter #0 [ <required> Monolog\Level|Psr\Log\LogLevel|string|int $level ]
): void
Log::emergency
predicates |
public | static |
System is unusable
public static function emergency(
Parameter #0 [ <required> Stringable|string $message ]
Parameter #1 [ <optional> array $context = [] ]
): void
Log::alert
predicates |
public | static |
Action must be taken immediately
Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
public static function alert(
Parameter #0 [ <required> Stringable|string $message ]
Parameter #1 [ <optional> array $context = [] ]
): void
Log::critical
predicates |
public | static |
Critical conditions
Example: Application component unavailable, unexpected exception.
public static function critical(
Parameter #0 [ <required> Stringable|string $message ]
Parameter #1 [ <optional> array $context = [] ]
): void
Log::error
predicates |
public | static |
Runtime errors that do not require immediate action but should typically be logged and monitored
public static function error(
Parameter #0 [ <required> Stringable|string $message ]
Parameter #1 [ <optional> array $context = [] ]
): void
Log::warning
predicates |
public | static |
Exceptional occurrences that are not errors
Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
public static function warning(
Parameter #0 [ <required> Stringable|string $message ]
Parameter #1 [ <optional> array $context = [] ]
): void
Log::notice
predicates |
public | static |
Normal but significant events
public static function notice(
Parameter #0 [ <required> Stringable|string $message ]
Parameter #1 [ <optional> array $context = [] ]
): void
Log::info
predicates |
public | static |
Interesting events
Example: User logs in, SQL logs.
public static function info(
Parameter #0 [ <required> Stringable|string $message ]
Parameter #1 [ <optional> array $context = [] ]
): void
Log::debug
predicates |
public | static |
Detailed debug information
public static function debug(
Parameter #0 [ <required> Stringable|string $message ]
Parameter #1 [ <optional> array $context = [] ]
): void
Log::log
predicates |
public | static |
Logs with an arbitrary level
public static function log(
Parameter #0 [ <required> Monolog\Level|string|int $level ]
Parameter #1 [ <required> Stringable|string $message ]
Parameter #2 [ <optional> array $context = [] ]
): void
Sat, 29 Apr 2023 12:38:18 +0000