19declare(strict_types=1);
22use Monolog\Processor\MemoryPeakUsageProcessor;
39 return $this->
getLogger()->isHandling($level);
44 $this->
getLogger()->log($level, $message, $context);
49 $this->
log(
'{dump}', $level, [
50 'dump' => print_r($value,
true),
54 public function debug(
string $message, array $context = []): void
56 $this->
getLogger()->debug($message, $context);
59 public function info(
string $message, array $context = []): void
61 $this->
getLogger()->info($message, $context);
64 public function notice(
string $message, array $context = []): void
66 $this->
getLogger()->notice($message, $context);
69 public function warning(
string $message, array $context = []): void
71 $this->
getLogger()->warning($message, $context);
74 public function error(
string $message, array $context = []): void
76 $this->
getLogger()->error($message, $context);
79 public function critical(
string $message, array $context = []): void
81 $this->
getLogger()->critical($message, $context);
84 public function alert(
string $message, array $context = []): void
86 $this->
getLogger()->alert($message, $context);
89 public function emergency(
string $message, array $context = []): void
91 $this->
getLogger()->emergency($message, $context);
109 $this->
getLogger()->log((
int) $level, $message, $context);
118 $this->
getLogger()->debug(
"Language (" . $lang_key .
"): topic -" . $topic .
"- not present");
121 public function logStack(?
int $level =
null,
string $message =
'', array $context = []): void
123 if (is_null($level)) {
133 throw new Exception($message);
134 }
catch (Exception $ex) {
135 $this->
getLogger()->log($level, $message .
"\n" . $ex->getTraceAsString(), $context);
145 $this->
getLogger()->pushProcessor(
new MemoryPeakUsageProcessor());
146 $this->
getLogger()->log($level,
'Memory usage: ');
Component logger with individual log levels by component id.
log(string $message, int $level=ilLogLevel::INFO, array $context=[])
emergency(string $message, array $context=[])
info(string $message, array $context=[])
critical(string $message, array $context=[])
notice(string $message, array $context=[])
writeLanguageLog(string $topic, string $lang_key)
Write language log.
isHandling(int $level)
Check whether current logger is handling a log level.
writeMemoryPeakUsage(int $level)
Write memory peak usage Automatically called at end of script.
alert(string $message, array $context=[])
write(string $message, $level=ilLogLevel::INFO, array $context=[])
write log message
dump($value, int $level=ilLogLevel::INFO)
debug(string $message, array $context=[])
warning(string $message, array $context=[])
__construct(private readonly Logger $logger)
error(string $message, array $context=[])
logStack(?int $level=null, string $message='', array $context=[])