From 8de3f5dab13443242b28ecc9c4e93fcdcfd31125 Mon Sep 17 00:00:00 2001 From: Bob Olde Hampsink Date: Tue, 12 Apr 2016 09:54:58 +0200 Subject: [PATCH] Fixed bug with reading default config values --- LogHelperPlugin.php | 12 ++++++------ README.md | 26 +++++++++++++++----------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/LogHelperPlugin.php b/LogHelperPlugin.php index 559328a..a8ab8cb 100644 --- a/LogHelperPlugin.php +++ b/LogHelperPlugin.php @@ -31,7 +31,7 @@ public function getName() */ public function getVersion() { - return '2.0.1'; + return '2.0.2'; } /** @@ -60,28 +60,28 @@ public function getDeveloperUrl() public function init() { // Disable web logging? - if (!craft()->config->get('useWebLog')) { + if (!craft()->config->get('useWebLog', 'logHelper')) { craft()->log->removeRoute('WebLogRoute'); } // Disable file logging? - if (!craft()->config->get('useFileLog')) { + if (!craft()->config->get('useFileLog', 'logHelper')) { craft()->log->removeRoute('FileLogRoute'); } // Disable profile logging? - if (!craft()->config->get('useProfileLog')) { + if (!craft()->config->get('useProfileLog', 'logHelper')) { craft()->log->removeRoute('ProfileLogRoute'); } // Use STDERR logging? - if (craft()->config->get('useStdErrLog')) { + if (craft()->config->get('useStdErrLog', 'logHelper')) { require_once __DIR__.'/logging/LogHelper_StdErrLogRoute.php'; craft()->log->addRoute('Craft\LogHelper_StdErrLogRoute'); } // Use SysLog logging? - if (craft()->config->get('useSysLog')) { + if (craft()->config->get('useSysLog', 'logHelper')) { require_once __DIR__.'/logging/LogHelper_SysLogRoute.php'; craft()->log->addRoute('Craft\LogHelper_SysLogRoute'); } diff --git a/README.md b/README.md index 1978b3c..a53d3eb 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,18 @@ ## Introduction -When [logging events and errors](https://craftcms.com/support/logs-and-backups), -Craft CMS writes to the `craft/storage/runtime/logs/craft.log.` and +When [logging events and errors](https://craftcms.com/support/logs-and-backups), +Craft CMS writes to the `craft/storage/runtime/logs/craft.log.` and `craft/storage/runtime/logs/phperrors.log` files. -This can cause problems on hosting environments that have an ephemeral +This can cause problems on hosting environments that have an ephemeral filesystem (like Heroku, Amazon EC2 and some Docker configurations) as -the log files will not be persisted and logging data will get lost. +the log files will not be persisted and logging data will get lost. This plugin adds the ability to Craft CMS to redirect logging output to other sources than the default log files. -## Installation +## Installation This plugin can be installed manually or [using Composer](https://getcomposer.org/doc/00-intro.md). @@ -23,15 +23,15 @@ The preferred means of installation is through Composer: composer require nerds-and-company/loghelper -This will add `nerds-and-company/loghelper` as a requirement to your -projects `composer.json` file and install the plugin into the +This will add `nerds-and-company/loghelper` as a requirement to your +projects `composer.json` file and install the plugin into the `craft/plugins/loghelper` directory. -### Manual +### Manual If installation through Composer is not an option, the package can also be installed manually. Download [the latest release](https://github.com/nerds-and-company/loghelper/releases/latest) -or clone the contents of this repository into the `craft/plugins/loghelper` +or clone the contents of this repository into the `craft/plugins/loghelper` directory. __Important:__ @@ -41,7 +41,7 @@ The plugin's folder **must** be named "loghelper" ## Usage This plugin offers different types of behaviour that can be configured -by editing the `craft/config/general.php` config file. +by editing the `craft/config/general.php` config file. ### Configuration @@ -82,7 +82,7 @@ This allows for disabling Craft's default behaviour. Determines whether logs should be written to STDERR (shell error output stream) or not. -Enabling this allows for viewing Craft logs on Heroku (or in tools that persist Heroku logs, like Papertrail). +Enabling this allows for viewing Craft logs on Heroku (or in tools that persist Heroku logs, like Papertrail). 'useStdErrLog' => false, @@ -132,6 +132,10 @@ This plugin has been licensed under the MIT License (MIT). Please see [License F ## Changelog +### 2.0.2 + +- Fixed bug with reading default config values + ### 2.0.1 - Adds more documentation