From 65c9e69ccbe53705435acd575d191f354828225e Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Thu, 31 Mar 2016 10:09:55 +0200 Subject: [PATCH 1/4] Changes headers in README file to one uniform format. --- README.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 49c272d..024fb8e 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,33 @@ -Log Helper plugin for Craft CMS -================= +# Log Helper plugin for Craft CMS Advanced logging options for Craft. __Important:__ + The plugin's folder should be named "loghelper" -Screenshots -================= -###Docker### +## Screenshots + +### Docker + ![Docker](http://nerds-and-company.github.io/loghelper/images/docker.png) -###Heroku### +### Heroku + ![Heroku](http://nerds-and-company.github.io/loghelper/images/heroku.png) -###Papertrail### +### Papertrail + ![Papertrail](http://nerds-and-company.github.io/loghelper/images/papertrail.png) -Changelog -================= -###2.0.0### +## Changelog + +### 2.0.0 + - Adds support for syslog logging, which is the default for Papertrail (non-Heroku) - Adds the ability to remove web, file and profile logging - Improves readability of the logs by appending newlines -###1.0.0### +### 1.0.0 + - Initial release From f54f1af06221b4a3df77c3570539a78f92fd7340 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Thu, 31 Mar 2016 12:02:14 +0200 Subject: [PATCH 2/4] Adds more documentation - Adds installation notes to the README file - Adds License information to the README file - Configuration options to the README file --- README.md | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 024fb8e..3ef68ab 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,111 @@ # Log Helper plugin for Craft CMS -Advanced logging options for Craft. +## 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 +`craft/storage/runtime/logs/phperrors.log` files. + +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. + +This plugin adds the ability to Craft CMS to redirect logging output to +other sources than the default log files. + +## Installation + +This plugin can be installed manually or [using Composer](https://getcomposer.org/doc/00-intro.md). + +### Composer + +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 +`craft/plugins/loghelper` directory. + +### 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` +directory. __Important:__ -The plugin's folder should be named "loghelper" +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. + +### Configuration + +The following settings are available: + +#### useFileLog + +|-|-| +| Accepts | `true` or `false` | +| Default | `true` | +| Since | v2.0.0 | + +Determines whether logs should be written to file or not. +This allows for disabling Craft's default behaviour. + + 'useFileLog' => true, + +#### useProfileLog + +|-|-| +| Accepts | `true` or `false` | +| Default | `true` | +| Since | v2.0.0 | + +Determines whether or not to displays profiling results in the browser's console window. +This allows for disabling Craft's default behaviour. + + 'useProfileLog' => true, + +#### useStdErrLog + +|-|-| +| Accepts | `true` or `false` | +| Default | `false` | +| Since | v2.0.0 | + +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). + + 'useStdErrLog' => false, + +#### useSysLog + +|-|-| +| Accepts | `true` or `false` | +| Default | `false` | +| Since | v2.0.0 | + +Determines whether logs should be written to [the system logs](https://en.wikipedia.org/wiki/Syslog) or not. +Enabling this allows tools that read from the system logs (like Papertrail when not on Heroku) to persist Craft logs. + + 'useSysLog' => false, + +#### useWebLog + +|-|-| +| Accepts | `true` or `false` | +| Default | `true` | +| Since | v2.0.0 | + +Determines whether or not to displays log content in the browser's console window. +This allows for disabling Craft's default behaviour. + + 'useWebLog' => true, ## Screenshots @@ -20,8 +121,16 @@ The plugin's folder should be named "loghelper" ![Papertrail](http://nerds-and-company.github.io/loghelper/images/papertrail.png) +## License + +This plugin has been licensed under the MIT License (MIT). Please see [License File](LICENSE) for more information. + ## Changelog +### 2.0.1 + +- Adds more documentation + ### 2.0.0 - Adds support for syslog logging, which is the default for Papertrail (non-Heroku) From 88d8b8b15f51048fe96f9a5267ea5489cc32a374 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Thu, 31 Mar 2016 12:08:44 +0200 Subject: [PATCH 3/4] Bumps the patch version (no features added or changed). --- LogHelperPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LogHelperPlugin.php b/LogHelperPlugin.php index fea202f..559328a 100644 --- a/LogHelperPlugin.php +++ b/LogHelperPlugin.php @@ -31,7 +31,7 @@ public function getName() */ public function getVersion() { - return '2.0.0'; + return '2.0.1'; } /** From c50418547c96cf415bb980d9b071fc57429305b3 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Thu, 31 Mar 2016 12:17:44 +0200 Subject: [PATCH 4/4] Fixes syntax for tables in README file. --- README.md | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 3ef68ab..1978b3c 100644 --- a/README.md +++ b/README.md @@ -49,10 +49,11 @@ The following settings are available: #### useFileLog -|-|-| -| Accepts | `true` or `false` | -| Default | `true` | -| Since | v2.0.0 | + + + + +
Acceptstrue or false
Defaulttrue
Sincev2.0.0
Determines whether logs should be written to file or not. This allows for disabling Craft's default behaviour. @@ -61,10 +62,11 @@ This allows for disabling Craft's default behaviour. #### useProfileLog -|-|-| -| Accepts | `true` or `false` | -| Default | `true` | -| Since | v2.0.0 | + + + + +
Acceptstrue or false
Defaulttrue
Sincev2.0.0
Determines whether or not to displays profiling results in the browser's console window. This allows for disabling Craft's default behaviour. @@ -73,10 +75,11 @@ This allows for disabling Craft's default behaviour. #### useStdErrLog -|-|-| -| Accepts | `true` or `false` | -| Default | `false` | -| Since | v2.0.0 | + + + + +
Acceptstrue or false
Defaultfalse
Sincev2.0.0
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). @@ -85,10 +88,11 @@ Enabling this allows for viewing Craft logs on Heroku (or in tools that persist #### useSysLog -|-|-| -| Accepts | `true` or `false` | -| Default | `false` | -| Since | v2.0.0 | + + + + +
Acceptstrue or false
Defaultfalse
Sincev2.0.0
Determines whether logs should be written to [the system logs](https://en.wikipedia.org/wiki/Syslog) or not. Enabling this allows tools that read from the system logs (like Papertrail when not on Heroku) to persist Craft logs. @@ -97,10 +101,11 @@ Enabling this allows tools that read from the system logs (like Papertrail when #### useWebLog -|-|-| -| Accepts | `true` or `false` | -| Default | `true` | -| Since | v2.0.0 | + + + + +
Acceptstrue or false
Defaulttrue
Sincev2.0.0
Determines whether or not to displays log content in the browser's console window. This allows for disabling Craft's default behaviour.