qshurick/pro_log

There is no license information available for the latest version (dev-master) of this package.

Logger

dev-master 2014-06-29 19:02 UTC

This package is not auto-updated.

Last update: 2024-05-11 13:26:07 UTC


README

Ensure in application.ini:

    autoloaderNamespaces[] = "Logger_"
    pluginPaths.Logger_Application_Resource_ = "Logger/Application/Resource"
    config.logger = APPLICATION_PATH "/configs/log.ini"

Ensure in include_path directory 'vendor/qshurick/pro_log/library', e.g. in public_html/index.php:

    set_include_path(implode(PATH_SEPARATOR, array(
        realpath(APPLICATION_PATH . '/../library'),
        realpath(APPLICATION_PATH . '/../vendor/qshurick/pro_log/library'),
        get_include_path(),
    )));
    require_once APPLICATION_PATH . '/../vendor/autoload.php';

Usage

  • with Zend_Registry:
    // Logger_Application_Logger
    Zend_Registry::get('logger')->log('Log message');
  • direct:
    // Logger_Application_Logger
    Logger_Application_Logger::getInstance()->log('Log message');
  • embed:
    class SomeLoggedClass {
        /** ... */
        function init() {
            /** ... */
            // Zend_Log
            $this->logger = Zend_Registry::get('logger')->ensureStream('custom-logger');
            $this->logger->log('Log message', Zend_Log::INFO);
            /** ... */
        }
        /** ... */
    }
  • deprecated (just for current compatibility)
    Pro_Log::log('Log message');