2017 © Pedro Peláez
 

library pro_log

Logger

image

qshurick/pro_log

Logger

  • Sunday, June 29, 2014
  • by qshurick
  • Repository
  • 1 Watchers
  • 0 Stars
  • 195 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Initialization

Ensure in application.ini:, (*1)

    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:, (*2)

    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');

The Versions

29/06 2014

dev-master

9999999-dev

Logger

  Sources   Download

The Development Requires

by Avatar qshurick