summaryrefslogtreecommitdiff
path: root/includes/sys_log.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-04-29 23:17:58 +0200
committermsquare <msquare@notrademark.de>2019-04-30 18:09:08 +0200
commitca0b2d8b5f650aad37b2d53577379efb4b468044 (patch)
treeb57ae5b4a9c3710223a94be691d682ca5db91a6b /includes/sys_log.php
parent9829e6da390c8a62f322e085cbf5b48a586446a0 (diff)
Improved email error logging
Diffstat (limited to 'includes/sys_log.php')
-rw-r--r--includes/sys_log.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/includes/sys_log.php b/includes/sys_log.php
index 595e8b55..9ac17dc0 100644
--- a/includes/sys_log.php
+++ b/includes/sys_log.php
@@ -1,14 +1,19 @@
<?php
+use Psr\Log\LoggerInterface;
+use Psr\Log\LogLevel;
+
/**
* Write a log entry.
* This should be used to log user's activity.
*
* @param string $message
+ * @param string $level
*/
-function engelsystem_log($message)
+function engelsystem_log($message, $level = LogLevel::INFO)
{
$nick = "Guest";
+ /** @var LoggerInterface $logger */
$logger = app('logger');
$user = auth()->user();
@@ -16,5 +21,5 @@ function engelsystem_log($message)
$nick = User_Nick_render($user);
}
- $logger->info('{nick}: {message}', ['nick' => $nick, 'message' => $message]);
+ $logger->log($level, '{nick}: {message}', ['nick' => $nick, 'message' => $message]);
}