mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-26 16:26:35 -06:00
commit
3832297d69
@ -24,6 +24,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Logging;
|
||||
|
||||
use Monolog\LogRecord;
|
||||
|
||||
/**
|
||||
* Class AuditProcessor
|
||||
*
|
||||
@ -32,14 +34,14 @@ namespace FireflyIII\Support\Logging;
|
||||
class AuditProcessor
|
||||
{
|
||||
/**
|
||||
* @param array $record
|
||||
* @param LogRecord $record
|
||||
*
|
||||
* @return array
|
||||
* @return LogRecord
|
||||
*/
|
||||
public function __invoke(array $record): array
|
||||
public function __invoke(LogRecord $record): LogRecord
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$record['message'] = sprintf(
|
||||
$message = sprintf(
|
||||
'AUDIT: %s (%s (%s) -> %s:%s)',
|
||||
$record['message'],
|
||||
app('request')->ip(),
|
||||
@ -47,11 +49,10 @@ class AuditProcessor
|
||||
request()->method(),
|
||||
request()->url()
|
||||
);
|
||||
|
||||
return $record;
|
||||
return new LogRecord($record->datetime, $record->channel, $record->level, $message, $record->context, $record->extra, $record->formatted);
|
||||
}
|
||||
|
||||
$record['message'] = sprintf(
|
||||
$message = sprintf(
|
||||
'AUDIT: %s (%s -> %s:%s)',
|
||||
$record['message'],
|
||||
app('request')->ip(),
|
||||
@ -59,6 +60,6 @@ class AuditProcessor
|
||||
request()->url()
|
||||
);
|
||||
|
||||
return $record;
|
||||
return new LogRecord($record->datetime, $record->channel, $record->level, $message, $record->context, $record->extra, $record->formatted);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user