xplo.re Medusa Core Framework 3.2
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
      • Driver
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Fault
      • Formatter
        • Driver
      • Incident
        • Exception
      • Reporter
        • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • Type
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Authentication
  • Authentication_Token
  • AutoLoader
  • Cache
  • Charset
  • ClassDescriptor
  • Closure
  • Configuration
  • Controller
  • Converter
  • Date
  • Decoder
  • Delegate
  • Dispatcher
  • Encoder
  • Env
  • Env_Field
  • Env_File
  • Env_FileList
  • Env_Request
  • Env_SERVER
  • Exchange
  • Fault
  • Field
  • Filter
  • Filter_Value
  • Formatter
  • Hash
  • IP
  • Loader
  • Locale
  • Locale_Node
  • Log
  • Module
  • Module_Iterator
  • Nothing
  • Object
  • OS
  • Plugin
  • Profiler
  • Query
  • Registry
  • Resource
  • Server
  • Session
  • Session_Token
  • Set
  • Storage
  • Storage_Result
  • Storage_Statement
  • Stream
  • Translation
  • URI
  • URI_Parameters
  • UUID
  • Value
  • Version
  • View

Interfaces

  • Accessor
  • Chainable
  • Comparable
  • Configurable
  • Equality
  • Identity
  • Inquiry
  • Masquerade
  • Mutator
  • SeekableStream
  • Storable
  • Variator

Exceptions

  • Exception

Constants

  • Copyright
  • ProductName
  • Version

Class Log

Driver-based logging interface with support for chaining.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Log

Direct known subclasses

Core\Log\Driver\stream, Core\Log\Driver\syslog

Abstract
Namespace: Core
Package: Core\Log
Since: 3.1
Requires: PHP 5.3
Version: 1.1
Located at Log.inc.php

Methods summary

protected
# __construct( Core\URI $uri )

Use auto-create factory to instantiate a logger instance.

Use auto-create factory to instantiate a logger instance.

Parameters

$uri
Factory driver URI.

Since

3.1
public true|array
# __invoke( string $priority, string $component, string $message, array $infoSet = null, array $sourceInfo = null )

Object invocation is an alias for the report()] method.

Object invocation is an alias for the report()] method.

Parameters

$priority
See Core\Log::report() method.
$component
See Core\Log::report() method.
$message
See Core\Log::report() method.
$infoSet
See Core\Log::report() method.
$sourceInfo
See Core\Log::report() method.

Returns

true|array
See Core\Log::report() method.

Since

3.1
protected string
# _formatUnifiedString( string $ident, string $component, string $message, array $infoSet = null, array $sourceInfo = null )

Formats a single string from log components. Should be used whenever components need to be unified into a single string. Also performs message postprocessing for generic placeholders, e.g. replaces %m by the error string returned from strerror() for the present value of errno().

Formats a single string from log components. Should be used whenever components need to be unified into a single string. Also performs message postprocessing for generic placeholders, e.g. replaces %m by the error string returned from strerror() for the present value of errno().

Parameters

$ident
Application identifier.
$component
See Core\Log::report() method.
$message
See Core\Log::report() method.
$infoSet
See Core\Log::report() method.
$sourceInfo
See Core\Log::report() method.

Returns

string

Since

3.1
abstract protected true|mixed
# _report( string $priority, string $ident, string $component, string $message, array $infoSet = null, array $sourceInfo = null )

Actual logger method implemented by drivers to process a new log entry.

Actual logger method implemented by drivers to process a new log entry.

Parameters

$priority
See Core\Log::report() method.
$ident
Application identifier from configuration.
$component
See Core\Log::report() method.
$message
See Core\Log::report() method.
$infoSet
See Core\Log::report() method.
$sourceInfo
See Core\Log::report() method.

Returns

true|mixed

A log driver must return true on success, any other return value is considered an error. Drivers may return additional error information.

Since

3.1
public static Core\Log
# autocreate( Core\URI $uri )

Logger factory.

Logger factory.

Parameters

$uri
Driver configuration URI.

Returns

Core\Log
New logger instance based on driver configuration URI.

Since

3.1
public integer|boolean
# chain( Core\Chainable $object, array $flags = null )

Connects another object to the current object. Usage depends on the actual class implementation; common examples are lazy configuration completion or layer expansions.

Connects another object to the current object. Usage depends on the actual class implementation; common examples are lazy configuration completion or layer expansions.

Parameters

$object
Object to chain to instance.
$flags

Optional array of additional chain flags. Usage depends on the actual chain implementation.

Returns

integer|boolean
Returns a non-zero value on success, otherwise false.

Throws

Core\Exception\InvalidArgument
Class of provided object is not supported.

Since

3.1

Overrides

Core\Object::chain
public string
# ident( )

Returns the configured application identifier.

Returns the configured application identifier.

Returns

string
Configured application identifier. Defaults to null.

Since

3.2
public true|mixed
# report( string $priority, string $component, string $message, array $infoSet = null, array $sourceInfo = null )

Creates a new log entry.

Creates a new log entry.

Varying from other chain implementations, the log system will not fail if a chained instance throws an exception during execution. This ensures that whenever a chained Log instance fails, the remaining instances will be executed. See return values for further information on how to detect failures in chain execution.

Parameters

$priority
Priority of log entry. Must equal one of the priority constants.
$component

Name of component that creates the log entry. Using the class name with full namespace information via the constant __CLASS__ is recommended.

$message
Content message of the log entry.
$infoSet

Arbitrary associative array of additional key-value pairs to include in the log entry.

$sourceInfo

Associative array with file, line and scope keys describing the source of the reported log entry.

Returns

true|mixed

If the execution of all chained instances succeeded, the returned value is true. Otherwise, an array is returned storing the return values of all failed instances. Array indices equal the position of the executed chain component. The size of the array may be smaller than the number of chained components; if the last array index is true, the corresponding chain component and all following components were successfully executed. The returned value contains the value true for all successful chain executions, an Core\Exception instance for all exceptions caught in the outer scope of the chain component or false, if a chained component returned a failure code.

Since

3.1

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), __toString(), attachMethod(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), hash(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

string Emergency

Emergency report priority, indicates that the system is unusable.

Emergency report priority, indicates that the system is unusable.

Since

3.1
# 'X'
string Alert

Significant report priority, immediate action required.

Significant report priority, immediate action required.

Since

3.1
# 'A'
string Critical

Critical report priority, system failure possible.

Critical report priority, system failure possible.

Since

3.1
# 'C'
string Error

Error report priority, application error conditions met.

Error report priority, application error conditions met.

Since

3.1
# 'E'
string Warning

Warning report priority, application warning conditions met.

Warning report priority, application warning conditions met.

Since

3.1
# 'W'
string Notice

Normal report priority, an at least significant condition is met.

Normal report priority, an at least significant condition is met.

Since

3.1
# 'N'
string Info

Info report priority.

Info report priority.

Since

3.1
# 'I'
string Debug

Debug report priority, should be used for debugging only.

Debug report priority, should be used for debugging only.

Since

3.1
# 'D'
string AcceptPriorityParameter

Configuration parameter to restrict logger to a given list of priorities.

Configuration parameter to restrict logger to a given list of priorities.

Since

3.2
# 'accept-priority'
string IdentParameter

Application identifier passed on to back-end driver.

Application identifier passed on to back-end driver.

Since

3.2
# 'ident'

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected array $_v_parameters

Driver configuration parameters.

Driver configuration parameters.

Since

3.2
#
protected Core\Log $_v_successor

Subsequent (chained) log system layer, if any.

Subsequent (chained) log system layer, if any.

Since

3.1
#

Magic properties

public read-only string $ident

Configured application ident string.

public read-only Core\Log $successor

Successor instance of logger chain.

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.2 API documentation generated by ApiGen