Module Purpose:

This module will benefit developers. Standard CMSMS installations will NOT benefit from this, as standard CMSMS logs will not go to Monolog.

Integrates https://github.com/Seldaek/monolog into CMS Made Simple

Installation

Post install, Monolog must be installed using Composer. Two choices:

  1. In module directory (/modules/CMSMonolog)
    cd modules/CMSMonolog
    composer update
  2. Globally, loaded via config.php
     composer require monolog/monolog 

    And in config.php:
    require_once __DIR__."/vendor/autoload.php";

How Do I Use It

After installation, logs are viewed in Site Admin -> CMS Monolog.

Logging is provided via the MLog static functions (levels are defined per Monolog)

 

Level
Method
Parameters
Debug MLog::d (channel, debug message, variable1, variable2, ...);
Info MLog::i (channel, debug message, variable1, variable2, ...);
Warning MLog::w (channel, debug message, variable1, variable2, ...);
Error MLog::e (channel, debug message, variable1, variable2, ...);
Critical MLog::c (channel, debug message, variable1, variable2, ...);
Alert MLog::a (channel, debug message, variable1, variable2, ...);

 

Example:

MLog::d(__METHOD__, "Starting process, parameters: ", $params);

If "Email on Error" is selected in settings (and your email is specified), then Error, Critical and Alert levels generate emails.

What Parameters Does It Take

None

Support

This software is provided as-is. Please read the text of the license for the full disclaimer.

Copyright and License

Copyright © 2015, Mike Crowe  <drmikecrowe@gmail.com>. All Rights Are Reserved.

Monolog is licensed under the MIT License - see the `LICENSE` file for details. You must agree to this license before using the module.