Giter Club home page Giter Club logo

loghelper's Introduction

Log Helper plugin for Craft CMS

Introduction

When logging events and errors, 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.

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 or clone the contents of this repository into the craft/plugins/loghelper directory.

Important:

The plugin's folder must be named "loghelper"

Usage

This plugin offers different types of behaviour that can be configured by editing/adding the craft/config/logHelper.php config file.

Configuration

The following settings are available:

useFileLog

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.

'useFileLog' => true,

useProfileLog

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.

'useProfileLog' => true,

useStdErrLog

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).

'useStdErrLog' => false,

useSysLog

Acceptstrue or false
Defaultfalse
Sincev2.0.0

Determines whether logs should be written to the system logs 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

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.

'useWebLog' => true,

Screenshots

Docker

Docker

Heroku

Heroku

Papertrail

Papertrail

License

This plugin has been licensed under the MIT License (MIT). Please see License File for more information.

Changelog

2.0.2

  • Fixed bug with reading default config values

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

  • Initial release

loghelper's People

Contributors

potherca avatar

Watchers

Tim Kelty avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.