Add papertrail logging.

This commit is contained in:
James Cole 2021-10-03 06:26:25 +02:00
parent aae80c348b
commit 1c9dc9926a
No known key found for this signature in database
GPG Key ID: BDE6667570EADBD5
2 changed files with 26 additions and 19 deletions

View File

@ -37,9 +37,16 @@ TRUSTED_PROXIES=
# Several other options exist. You can use 'single' for one big fat error log (not recommended).
# Also available are 'syslog', 'errorlog' and 'stdout' which will log to the system itself.
# A rotating log option is 'daily', creates 5 files that (surprise) rotate.
# A cool option is 'papertrail' for cloud logging
# Default setting 'stack' will log to 'daily' and to 'stdout' at the same time.
LOG_CHANNEL=stack
#
# Used when logging to papertrail:
#
PAPERTRAIL_HOST=
PAPERTRAIL_PORT=
# Log level. You can set this from least severe to most severe:
# debug, info, notice, warning, error, critical, alert, emergency
# If you set it to debug your logs will grow large, and fast. If you set it to emergency probably

View File

@ -52,6 +52,7 @@ return [
*/
'channels' => [
// default channels for 'stack' and audit logs:
'stack' => [
'driver' => 'stack',
'channels' => ['daily', 'stdout'],
@ -60,27 +61,38 @@ return [
'driver' => 'stack',
'channels' => ['audit_daily', 'audit_stdout'],
],
'scoped' => [
'driver' => 'custom',
'via' => FireflyIII\Logging\CreateCustomLogger::class,
],
'papertrail' => [
'host' => env('PAPERTRAIL_HOST'),
'port' => env('PAPERTRAIL_PORT'),
],
// single laravel log file:
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
],
// stdout, used in stack 'stack' by default:
'stdout' => [
'driver' => 'single',
'path' => 'php://stdout',
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
],
'docker_out' => [
'driver' => 'single',
'path' => 'php://stdout',
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
],
// daily, used in stack 'stack' by default:
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/ff3-' . PHP_SAPI . '.log'),
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
'days' => 7,
],
// the audit log destinations:
'audit_daily' => [
'driver' => 'daily',
'path' => storage_path('logs/ff3-audit.log'),
@ -94,26 +106,14 @@ return [
'tap' => [AuditLogger::class],
'level' => envNonEmpty('AUDIT_LOG_LEVEL', 'info'),
],
'dailytest' => [
'driver' => 'daily',
'path' => storage_path('logs/test-ff3-' . PHP_SAPI . '.log'),
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
'days' => 7,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Firefly III Log Robot',
'emoji' => ':boom:',
'level' => 'error',
],
// syslog destination
'syslog' => [
'driver' => 'syslog',
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),
],
// errorlog destination
'errorlog' => [
'driver' => 'errorlog',
'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),