Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • AbstractLogAdapter
  • ArrayLogAdapter
  • ClosureLogAdapter
  • MessageFormatter
  • MonologLogAdapter
  • PsrLogAdapter
  • Zf1LogAdapter
  • Zf2LogAdapter

Interfaces

  • LogAdapterInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: namespace Guzzle\Log;
 4: 
 5: use Monolog\Logger;
 6: 
 7: /**
 8:  * Monolog log adapter
 9:  *
10:  * @link https://github.com/Seldaek/monolog
11:  */
12: class MonologLogAdapter extends AbstractLogAdapter
13: {
14:     /**
15:      * syslog to Monolog mappings
16:      */
17:     private static $mapping = array(
18:         LOG_DEBUG   => Logger::DEBUG,
19:         LOG_INFO    => Logger::INFO,
20:         LOG_WARNING => Logger::WARNING,
21:         LOG_ERR     => Logger::ERROR,
22:         LOG_CRIT    => Logger::CRITICAL,
23:         LOG_ALERT   => Logger::ALERT
24:     );
25: 
26:     /**
27:      * {@inheritdoc}
28:      */
29:     public function __construct(Logger $logObject)
30:     {
31:         $this->log = $logObject;
32:     }
33: 
34:     /**
35:      * {@inheritdoc}
36:      */
37:     public function log($message, $priority = LOG_INFO, $extras = null)
38:     {
39:         $this->log->addRecord(self::$mapping[$priority], $message);
40:     }
41: }
42: 
php-coveralls API documentation generated by ApiGen 2.8.0