Skip to content

qshurick/Pro_Log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Initialization

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

About

Logging in Zend 1.x version

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages