-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from nerds-and-company/feature/improve-document…
…ation 📖 Improves documentation
- Loading branch information
Showing
2 changed files
with
133 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ public function getName() | |
*/ | ||
public function getVersion() | ||
{ | ||
return '2.0.0'; | ||
return '2.0.1'; | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,147 @@ | ||
Log Helper plugin for Craft CMS | ||
================= | ||
# 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" | ||
|
||
Screenshots | ||
================= | ||
###Docker### | ||
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 | ||
|
||
<table> | ||
<tr><td>Accepts</td><td><code>true</code> or <code>false</code></td></tr> | ||
<tr><td>Default</td><td><code>true</code></td></tr> | ||
<tr><td>Since</td><td>v2.0.0</td></tr> | ||
</table> | ||
|
||
Determines whether logs should be written to file or not. | ||
This allows for disabling Craft's default behaviour. | ||
|
||
'useFileLog' => true, | ||
|
||
#### useProfileLog | ||
|
||
<table> | ||
<tr><td>Accepts</td><td><code>true</code> or <code>false</code></td></tr> | ||
<tr><td>Default</td><td><code>true</code></td></tr> | ||
<tr><td>Since</td><td>v2.0.0</td></tr> | ||
</table> | ||
|
||
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 | ||
|
||
<table> | ||
<tr><td>Accepts</td><td><code>true</code> or <code>false</code></td></tr> | ||
<tr><td>Default</td><td><code>false</code></td></tr> | ||
<tr><td>Since</td><td>v2.0.0</td></tr> | ||
</table> | ||
|
||
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 | ||
|
||
<table> | ||
<tr><td>Accepts</td><td><code>true</code> or <code>false</code></td></tr> | ||
<tr><td>Default</td><td><code>false</code></td></tr> | ||
<tr><td>Since</td><td>v2.0.0</td></tr> | ||
</table> | ||
|
||
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 | ||
|
||
<table> | ||
<tr><td>Accepts</td><td><code>true</code> or <code>false</code></td></tr> | ||
<tr><td>Default</td><td><code>true</code></td></tr> | ||
<tr><td>Since</td><td>v2.0.0</td></tr> | ||
</table> | ||
|
||
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 | ||
|
||
### Docker | ||
|
||
 | ||
|
||
###Heroku### | ||
### Heroku | ||
|
||
 | ||
|
||
###Papertrail### | ||
### Papertrail | ||
|
||
 | ||
|
||
Changelog | ||
================= | ||
###2.0.0### | ||
## 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) | ||
- 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 |