Change some logging settings.

This commit is contained in:
James Cole 2023-08-30 15:38:15 +02:00
parent 0e7712d3b8
commit 592fc71b4e
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
3 changed files with 27 additions and 6 deletions

View File

@ -58,8 +58,20 @@ PAPERTRAIL_PORT=
APP_LOG_LEVEL=notice
# Audit log level.
# Set this to "emergency" if you dont want to store audit logs, leave on info otherwise.
AUDIT_LOG_LEVEL=info
# The audit log is used to log notable Firefly III events on a separate channel.
# These log entries may contain sensitive financial information.
# The audit log is disabled by default.
#
# To enable it, set AUDIT_LOG_LEVEL to "info"
# To disable it, set AUDIT_LOG_LEVEL to "emergency"
AUDIT_LOG_LEVEL=emergency
#
# If you want, you can redirect the audit logs to another channel.
# Options are: 'papertrail', 'syslog' OR 'errorlog'
#
# If you do this, the audit logs may be mixed with normal logs (if they also use the same channel).
AUDIT_LOG_CHANNEL=
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
# For other database types, please see the FAQ: https://docs.firefly-iii.org/firefly-iii/faq/self-hosted/#i-want-to-use-sqlite

View File

@ -57,7 +57,7 @@ class VersionCheckEventHandler
$permission = app('fireflyconfig')->get('permission_update_check', -1);
$value = (int)$permission->data;
if (1 !== $value) {
Log::info('Update check is not enabled.');
Log::debug('Update check is not enabled.');
$this->warnToCheckForUpdates($event);
return;
@ -103,7 +103,7 @@ class VersionCheckEventHandler
$repository = app(UserRepositoryInterface::class);
$user = $event->user;
if (!$repository->hasRole($user, 'owner')) {
Log::debug('User is not admin, done.');
Log::notice('User is not admin, done.');
return;
}

View File

@ -24,6 +24,15 @@ declare(strict_types=1);
use FireflyIII\Support\Logging\AuditLogger;
use Monolog\Handler\SyslogUdpHandler;
// to correctly redirect audit channel messages the
// options for the audit stack are set here, but can be overruled
// from an environment variable:
$auditChannels = ['audit_daily', 'audit_stdout'];
$option = envNonEmpty('AUDIT_LOG_CHANNEL', '');
if ('' !== (string)$option) {
$auditChannels = [$option];
}
return [
/*
|--------------------------------------------------------------------------
@ -53,14 +62,14 @@ return [
*/
'channels' => [
// default channels for 'stack' and audit logs:
// default channels for 'stack' and 'audit' logs are stdout and daily logs.
'stack' => [
'driver' => 'stack',
'channels' => ['daily', 'stdout'],
],
'audit' => [
'driver' => 'stack',
'channels' => ['audit_daily', 'audit_stdout'],
'channels' => $auditChannels,
],
'papertrail' => [
'driver' => 'monolog',