Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Update config for logging in Docker.
James Cole379c540bd851
diff --git a/.env.docker b/.env.dockerindex 502b81ef49..a3e9fe9573 100644--- a/.env.docker+++ b/.env.docker@@ -13,32 +13,34 @@ SITE_OWNER=${SITE_OWNER}# Change it to a string of exactly 32 chars or use command `php artisan key:generate` to generate itAPP_KEY=${FF_APP_KEY}+# Change this value to your preferred time zone.+# Example: Europe/Amsterdam+TZ=UTC+# APP_URL and TRUSTED_PROXIES are useful when using Docker and/or a reverse proxy.APP_URL=${APP_URL}TRUSTED_PROXIES=${TRUSTED_PROXIES}# The log channel defines where your log entries go to.-LOG_CHANNEL=${LOG_CHANNEL}--# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III-# If you use SQLite, set connection to `sqlite` and remove the database, username and password settings.-DB_CONNECTION=${FF_DB_CONNECTION}-DB_HOST=${FF_DB_HOST}-DB_PORT=${FF_DB_PORT}-DB_DATABASE=${FF_DB_NAME}-DB_USERNAME=${FF_DB_USER}-DB_PASSWORD=${FF_DB_PASSWORD}-# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.# Several other options exist. You can use 'single' for one big fat error log (not recommended).-# Also available are 'syslog' and 'errorlog' which will log to the system itself.-APP_LOG=syslog+# Also available are 'syslog', 'errorlog' and 'stdout' which will log to the system itself.+LOG_CHANNEL=stdout# 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# nothing will get logged, ever.-APP_LOG_LEVEL=info+APP_LOG_LEVEL=notice++# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III+# For other database types, please see the FAQ: http://firefly-iii.readthedocs.io/en/latest/support/faq.html+DB_CONNECTION=mysql+DB_HOST=127.0.0.1+DB_PORT=3306+DB_DATABASE=homestead+DB_USERNAME=homestead+DB_PASSWORD=secret# If you're looking for performance improvements, you could install memcached.CACHE_DRIVER=file@@ -103,4 +105,5 @@ IS_DOCKER=trueIS_SANDSTORM=falseIS_HEROKU=falseBUNQ_USE_SANDBOX=false-TZ=${TZ}+MAILGUN_DOMAIN=+MAILGUN_SECRET=diff --git a/.env.example b/.env.exampleindex 73afaf0470..0daa6aee41 100644--- a/.env.example+++ b/.env.example@@ -15,15 +15,24 @@ APP_KEY=SomeRandomStringOf32CharsExactly# Change this value to your preferred time zone.# Example: Europe/Amsterdam-TZ=UTC+TZ=${TZ}# APP_URL and TRUSTED_PROXIES are useful when using Docker and/or a reverse proxy.APP_URL=http://localhostTRUSTED_PROXIES=# The log channel defines where your log entries go to.+# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.+# 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.LOG_CHANNEL=daily+# 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+# nothing will get logged, ever.+APP_LOG_LEVEL=notice+# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III# For other database types, please see the FAQ: http://firefly-iii.readthedocs.io/en/latest/support/faq.htmlDB_CONNECTION=mysql@@ -33,17 +42,6 @@ DB_DATABASE=homesteadDB_USERNAME=homesteadDB_PASSWORD=secret-# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.-# Several other options exist. You can use 'single' for one big fat error log (not recommended).-# Also available are 'syslog' and 'errorlog' which will log to the system itself.-APP_LOG=daily--# 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-# nothing will get logged, ever.-APP_LOG_LEVEL=notice-# If you're looking for performance improvements, you could install memcached.CACHE_DRIVER=fileSESSION_DRIVER=file@@ -105,7 +103,7 @@ DEMO_USERNAME=DEMO_PASSWORD=IS_DOCKER=falseIS_SANDSTORM=false-BUNQ_USE_SANDBOX=falseIS_HEROKU=false+BUNQ_USE_SANDBOX=falseMAILGUN_DOMAIN=MAILGUN_SECRET=diff --git a/.env.heroku b/.env.herokuindex 13de7aa0b4..4925830036 100644--- a/.env.heroku+++ b/.env.heroku@@ -22,7 +22,16 @@ APP_URL=http://localhostTRUSTED_PROXIES=# The log channel defines where your log entries go to.-LOG_CHANNEL=syslog+# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.+# 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.+LOG_CHANNEL=stdout++# 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+# nothing will get logged, ever.+APP_LOG_LEVEL=debug# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III# If you use SQLite, set connection to `sqlite` and remove the database, username and password settings.@@ -33,17 +42,6 @@ DB_CONNECTION=pgsql-# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.-# Several other options exist. You can use 'single' for one big fat error log (not recommended).-# Also available are 'syslog' and 'errorlog' which will log to the system itself.-APP_LOG=syslog--# 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-# nothing will get logged, ever.-APP_LOG_LEVEL=debug-# If you're looking for performance improvements, you could install memcached.CACHE_DRIVER=fileSESSION_DRIVER=file@@ -105,7 +103,7 @@ DEMO_USERNAME=DEMO_PASSWORD=IS_DOCKER=falseIS_SANDSTORM=false-BUNQ_USE_SANDBOX=falseIS_HEROKU=true+BUNQ_USE_SANDBOX=falseMAILGUN_DOMAIN=MAILGUN_SECRET=diff --git a/.env.sandstorm b/.env.sandstormindex 5895f63467..138001852b 100755--- a/.env.sandstorm+++ b/.env.sandstorm@@ -22,7 +22,16 @@ APP_URL=http://localhostTRUSTED_PROXIES=# The log channel defines where your log entries go to.-LOG_CHANNEL=syslog+# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.+# 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.+LOG_CHANNEL=stdout++# 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+# nothing will get logged, ever.+APP_LOG_LEVEL=debug# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III# If you use SQLite, set connection to `sqlite` and remove the database, username and password settings.@@ -33,17 +42,6 @@ DB_DATABASE=fireflyDB_USERNAME=fireflyDB_PASSWORD=firefly-# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.-# Several other options exist. You can use 'single' for one big fat error log (not recommended).-# Also available are 'syslog' and 'errorlog' which will log to the system itself.-APP_LOG=syslog--# 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-# nothing will get logged, ever.-APP_LOG_LEVEL=info-# If you're looking for performance improvements, you could install memcached.CACHE_DRIVER=fileSESSION_DRIVER=file@@ -105,7 +103,7 @@ DEMO_USERNAME=DEMO_PASSWORD=IS_DOCKER=falseIS_SANDSTORM=true-BUNQ_USE_SANDBOX=falseIS_HEROKU=false+BUNQ_USE_SANDBOX=falseMAILGUN_DOMAIN=MAILGUN_SECRET=diff --git a/.env.testing b/.env.testingindex 6eec082239..94958107bb 100644--- a/.env.testing+++ b/.env.testing@@ -22,16 +22,10 @@ APP_URL=http://localhostTRUSTED_PROXIES=# The log channel defines where your log entries go to.-LOG_CHANNEL=dailytest--# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III-# For other database types, please see the FAQ: http://firefly-iii.readthedocs.io/en/latest/support/faq.html-DB_CONNECTION=sqlite-# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.# Several other options exist. You can use 'single' for one big fat error log (not recommended).-# Also available are 'syslog' and 'errorlog' which will log to the system itself.-APP_LOG=daily+# Also available are 'syslog', 'errorlog' and 'stdout' which will log to the system itself.+LOG_CHANNEL=dailytest# Log level. You can set this from least severe to most severe:# debug, info, notice, warning, error, critical, alert, emergency@@ -39,6 +33,15 @@ APP_LOG=daily# nothing will get logged, ever.APP_LOG_LEVEL=debug+# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III+# For other database types, please see the FAQ: http://firefly-iii.readthedocs.io/en/latest/support/faq.html+DB_CONNECTION=sqlite++++++# If you're looking for performance improvements, you could install memcached.CACHE_DRIVER=fileSESSION_DRIVER=file@@ -64,6 +67,9 @@ MAILGUN_SECRET=MANDRILL_SECRET=SPARKPOST_SECRET=+# Firefly III can send you the following messages+SEND_REGISTRATION_MAIL=true+SEND_ERROR_MESSAGE=false# Set a Mapbox API key here (see mapbox.com) so there might be a map available at various places.MAPBOX_API_KEY=@@ -97,7 +103,7 @@ DEMO_USERNAME=DEMO_PASSWORD=IS_DOCKER=falseIS_SANDSTORM=false-BUNQ_USE_SANDBOX=trueIS_HEROKU=false+BUNQ_USE_SANDBOX=trueMAILGUN_DOMAIN=MAILGUN_SECRET=diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.phpindex 79809ef843..704adde592 100644--- a/app/Http/Controllers/DebugController.php+++ b/app/Http/Controllers/DebugController.php@@ -136,7 +136,7 @@ class DebugController extends Controller$errorReporting = $this->errorReporting((int)ini_get('error_reporting'));$appEnv = env('APP_ENV', '');$appDebug = var_export(env('APP_DEBUG', false), true);- $appLog = env('APP_LOG', '');+ $logChannel = env('LOG_CHANNEL', '');$appLogLevel = env('APP_LOG_LEVEL', '');$packages = $this->collectPackages();$cacheDriver = env('CACHE_DRIVER', 'unknown');@@ -175,7 +175,7 @@ class DebugController extends Controllerreturn view('debug', compact(- 'phpVersion', 'extensions', 'localeAttempts', 'appEnv', 'appDebug', 'appLog', 'appLogLevel', 'now', 'packages', 'drivers',+ 'phpVersion', 'extensions', 'localeAttempts', 'appEnv', 'appDebug', 'logChannel', 'appLogLevel', 'now', 'packages', 'drivers','currentDriver','userAgent', 'displayErrors', 'errorReporting', 'phpOs', 'interface', 'logContent', 'cacheDriver', 'isDocker', 'isSandstorm','trustedProxies',diff --git a/config/app.php b/config/app.phpindex 5127530c6d..47d80fc8ba 100644--- a/config/app.php+++ b/config/app.php@@ -32,8 +32,6 @@ return ['fallback_locale' => 'en_US','key' => env('APP_KEY'),'cipher' => 'AES-256-CBC',- 'log' => envNonEmpty('APP_LOG', 'errorlog'),- 'log_level' => envNonEmpty('APP_LOG_LEVEL', 'info'),'providers' => [/*diff --git a/config/logging.php b/config/logging.phpindex 3e1dcfd1f3..1ac3fb0284 100644--- a/config/logging.php+++ b/config/logging.php@@ -59,7 +59,12 @@ return ['single' => ['driver' => 'single','path' => storage_path('logs/laravel.log'),- 'level' => 'debug',+ 'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),+ ],+ 'stdout' => [+ 'driver' => 'single',+ 'path' => 'php://stdout',+ 'level' => envNonEmpty('APP_LOG_LEVEL', 'info'),],'daily' => [diff --git a/resources/views/debug.twig b/resources/views/debug.twigindex 7d57662635..57c1408034 100644--- a/resources/views/debug.twig+++ b/resources/views/debug.twig@@ -19,7 +19,7 @@ Debug information generated at {{ now }} for Firefly III version **{{ FF_VERSION| App environment | {{ appEnv }} || App debug mode | {{ appDebug }} || App cache driver | {{ cacheDriver }} |-| App logging | {{ appLogLevel }}, {{ appLog }} |+| App logging | {{ appLogLevel }}, {{ logChannel }} || PHP version | {{ phpVersion }} || Display errors | {{ displayErrors }} || Session start | {{ session('start') }} |