6 * This is a simple Logger implementation that other Loggers can inherit from.
8 * It simply delegates all log-level-specific methods to the `log` method to
9 * reduce boilerplate code that a simple Logger that does the same thing with
10 * messages regardless of the error level has to implement.
12 abstract class AbstractLogger implements LoggerInterface
17 * @param string $message
18 * @param array $context
22 public function emergency($message, array $context = array())
24 $this->log(LogLevel::EMERGENCY, $message, $context);
28 * Action must be taken immediately.
30 * Example: Entire website down, database unavailable, etc. This should
31 * trigger the SMS alerts and wake you up.
33 * @param string $message
34 * @param array $context
38 public function alert($message, array $context = array())
40 $this->log(LogLevel::ALERT, $message, $context);
44 * Critical conditions.
46 * Example: Application component unavailable, unexpected exception.
48 * @param string $message
49 * @param array $context
53 public function critical($message, array $context = array())
55 $this->log(LogLevel::CRITICAL, $message, $context);
59 * Runtime errors that do not require immediate action but should typically
60 * be logged and monitored.
62 * @param string $message
63 * @param array $context
67 public function error($message, array $context = array())
69 $this->log(LogLevel::ERROR, $message, $context);
73 * Exceptional occurrences that are not errors.
75 * Example: Use of deprecated APIs, poor use of an API, undesirable things
76 * that are not necessarily wrong.
78 * @param string $message
79 * @param array $context
83 public function warning($message, array $context = array())
85 $this->log(LogLevel::WARNING, $message, $context);
89 * Normal but significant events.
91 * @param string $message
92 * @param array $context
96 public function notice($message, array $context = array())
98 $this->log(LogLevel::NOTICE, $message, $context);
102 * Interesting events.
104 * Example: User logs in, SQL logs.
106 * @param string $message
107 * @param array $context
111 public function info($message, array $context = array())
113 $this->log(LogLevel::INFO, $message, $context);
117 * Detailed debug information.
119 * @param string $message
120 * @param array $context
124 public function debug($message, array $context = array())
126 $this->log(LogLevel::DEBUG, $message, $context);