1*dad993c5SAndreas Gohr<?php 2*dad993c5SAndreas Gohr 3*dad993c5SAndreas Gohrnamespace Psr\Log; 4*dad993c5SAndreas Gohr 5*dad993c5SAndreas Gohr/** 6*dad993c5SAndreas Gohr * Describes a logger instance. 7*dad993c5SAndreas Gohr * 8*dad993c5SAndreas Gohr * The message MUST be a string or object implementing __toString(). 9*dad993c5SAndreas Gohr * 10*dad993c5SAndreas Gohr * The message MAY contain placeholders in the form: {foo} where foo 11*dad993c5SAndreas Gohr * will be replaced by the context data in key "foo". 12*dad993c5SAndreas Gohr * 13*dad993c5SAndreas Gohr * The context array can contain arbitrary data. The only assumption that 14*dad993c5SAndreas Gohr * can be made by implementors is that if an Exception instance is given 15*dad993c5SAndreas Gohr * to produce a stack trace, it MUST be in a key named "exception". 16*dad993c5SAndreas Gohr * 17*dad993c5SAndreas Gohr * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md 18*dad993c5SAndreas Gohr * for the full interface specification. 19*dad993c5SAndreas Gohr */ 20*dad993c5SAndreas Gohrinterface LoggerInterface 21*dad993c5SAndreas Gohr{ 22*dad993c5SAndreas Gohr /** 23*dad993c5SAndreas Gohr * System is unusable. 24*dad993c5SAndreas Gohr * 25*dad993c5SAndreas Gohr * @param string $message 26*dad993c5SAndreas Gohr * @param mixed[] $context 27*dad993c5SAndreas Gohr * 28*dad993c5SAndreas Gohr * @return void 29*dad993c5SAndreas Gohr */ 30*dad993c5SAndreas Gohr public function emergency($message, array $context = array()); 31*dad993c5SAndreas Gohr 32*dad993c5SAndreas Gohr /** 33*dad993c5SAndreas Gohr * Action must be taken immediately. 34*dad993c5SAndreas Gohr * 35*dad993c5SAndreas Gohr * Example: Entire website down, database unavailable, etc. This should 36*dad993c5SAndreas Gohr * trigger the SMS alerts and wake you up. 37*dad993c5SAndreas Gohr * 38*dad993c5SAndreas Gohr * @param string $message 39*dad993c5SAndreas Gohr * @param mixed[] $context 40*dad993c5SAndreas Gohr * 41*dad993c5SAndreas Gohr * @return void 42*dad993c5SAndreas Gohr */ 43*dad993c5SAndreas Gohr public function alert($message, array $context = array()); 44*dad993c5SAndreas Gohr 45*dad993c5SAndreas Gohr /** 46*dad993c5SAndreas Gohr * Critical conditions. 47*dad993c5SAndreas Gohr * 48*dad993c5SAndreas Gohr * Example: Application component unavailable, unexpected exception. 49*dad993c5SAndreas Gohr * 50*dad993c5SAndreas Gohr * @param string $message 51*dad993c5SAndreas Gohr * @param mixed[] $context 52*dad993c5SAndreas Gohr * 53*dad993c5SAndreas Gohr * @return void 54*dad993c5SAndreas Gohr */ 55*dad993c5SAndreas Gohr public function critical($message, array $context = array()); 56*dad993c5SAndreas Gohr 57*dad993c5SAndreas Gohr /** 58*dad993c5SAndreas Gohr * Runtime errors that do not require immediate action but should typically 59*dad993c5SAndreas Gohr * be logged and monitored. 60*dad993c5SAndreas Gohr * 61*dad993c5SAndreas Gohr * @param string $message 62*dad993c5SAndreas Gohr * @param mixed[] $context 63*dad993c5SAndreas Gohr * 64*dad993c5SAndreas Gohr * @return void 65*dad993c5SAndreas Gohr */ 66*dad993c5SAndreas Gohr public function error($message, array $context = array()); 67*dad993c5SAndreas Gohr 68*dad993c5SAndreas Gohr /** 69*dad993c5SAndreas Gohr * Exceptional occurrences that are not errors. 70*dad993c5SAndreas Gohr * 71*dad993c5SAndreas Gohr * Example: Use of deprecated APIs, poor use of an API, undesirable things 72*dad993c5SAndreas Gohr * that are not necessarily wrong. 73*dad993c5SAndreas Gohr * 74*dad993c5SAndreas Gohr * @param string $message 75*dad993c5SAndreas Gohr * @param mixed[] $context 76*dad993c5SAndreas Gohr * 77*dad993c5SAndreas Gohr * @return void 78*dad993c5SAndreas Gohr */ 79*dad993c5SAndreas Gohr public function warning($message, array $context = array()); 80*dad993c5SAndreas Gohr 81*dad993c5SAndreas Gohr /** 82*dad993c5SAndreas Gohr * Normal but significant events. 83*dad993c5SAndreas Gohr * 84*dad993c5SAndreas Gohr * @param string $message 85*dad993c5SAndreas Gohr * @param mixed[] $context 86*dad993c5SAndreas Gohr * 87*dad993c5SAndreas Gohr * @return void 88*dad993c5SAndreas Gohr */ 89*dad993c5SAndreas Gohr public function notice($message, array $context = array()); 90*dad993c5SAndreas Gohr 91*dad993c5SAndreas Gohr /** 92*dad993c5SAndreas Gohr * Interesting events. 93*dad993c5SAndreas Gohr * 94*dad993c5SAndreas Gohr * Example: User logs in, SQL logs. 95*dad993c5SAndreas Gohr * 96*dad993c5SAndreas Gohr * @param string $message 97*dad993c5SAndreas Gohr * @param mixed[] $context 98*dad993c5SAndreas Gohr * 99*dad993c5SAndreas Gohr * @return void 100*dad993c5SAndreas Gohr */ 101*dad993c5SAndreas Gohr public function info($message, array $context = array()); 102*dad993c5SAndreas Gohr 103*dad993c5SAndreas Gohr /** 104*dad993c5SAndreas Gohr * Detailed debug information. 105*dad993c5SAndreas Gohr * 106*dad993c5SAndreas Gohr * @param string $message 107*dad993c5SAndreas Gohr * @param mixed[] $context 108*dad993c5SAndreas Gohr * 109*dad993c5SAndreas Gohr * @return void 110*dad993c5SAndreas Gohr */ 111*dad993c5SAndreas Gohr public function debug($message, array $context = array()); 112*dad993c5SAndreas Gohr 113*dad993c5SAndreas Gohr /** 114*dad993c5SAndreas Gohr * Logs with an arbitrary level. 115*dad993c5SAndreas Gohr * 116*dad993c5SAndreas Gohr * @param mixed $level 117*dad993c5SAndreas Gohr * @param string $message 118*dad993c5SAndreas Gohr * @param mixed[] $context 119*dad993c5SAndreas Gohr * 120*dad993c5SAndreas Gohr * @return void 121*dad993c5SAndreas Gohr * 122*dad993c5SAndreas Gohr * @throws \Psr\Log\InvalidArgumentException 123*dad993c5SAndreas Gohr */ 124*dad993c5SAndreas Gohr public function log($level, $message, array $context = array()); 125*dad993c5SAndreas Gohr} 126