Microsoft_Log
[ class tree: Microsoft_Log ] [ index: Microsoft_Log ] [ all elements ]

Class: Microsoft_Log

Source Location: /Log.php

Class Overview




Author(s):

Version:

  • $Id: Log.php 22632 2010-07-18 18:30:08Z ramon $

Copyright:

  • Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

Variables

Constants

Methods



Class Details

[line 34]


Tags:

version:  $Id: Log.php 22632 2010-07-18 18:30:08Z ramon $
copyright:  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license:  New BSD License


[ Top ]


Class Variables

$_defaultFilterNamespace =  'Microsoft_Log_Filter'

[line 76]



Tags:

access:  protected

Type:   string


[ Top ]

$_defaultWriterNamespace =  'Microsoft_Log_Writer'

[line 70]



Tags:

access:  protected

Type:   string


[ Top ]

$_extras = array()

[line 64]



Tags:

var:  of extra log event
access:  protected

Type:   array


[ Top ]

$_filters = array()

[line 59]



Tags:

var:  of Microsoft_Log_Filter_Interface
access:  protected

Type:   array


[ Top ]

$_priorities = array()

[line 49]



Tags:

var:  of priorities where the keys are the priority numbers and the values are the priority names
access:  protected

Type:   array


[ Top ]

$_writers = array()

[line 54]



Tags:

var:  of Microsoft_Log_Writer_Abstract
access:  protected

Type:   array


[ Top ]



Class Methods


static method factory [line 101]

static Microsoft_Log factory( [array $config = array()])

Factory to construct the logger and one or more writers based on the configuration array



Tags:

access:  public


Parameters:

array   $config  

[ Top ]

constructor __construct [line 84]

Microsoft_Log __construct( [Microsoft_Log_Writer_Abstract $writer = null])

Class constructor. Create a new logger



Tags:

access:  public


Parameters:

Microsoft_Log_Writer_Abstract|null   $writer   default writer

[ Top ]

destructor __destruct [line 235]

void __destruct( )

Class destructor. Shutdown log writers



Tags:

access:  public


[ Top ]

method addFilter [line 371]

void addFilter( int|Microsoft_Log_Filter_Interface $filter)

Add a filter that will be applied before all log writers.

Before a message will be received by any of the writers, it must be accepted by all filters added with this method.




Tags:

access:  public


Parameters:

int|Microsoft_Log_Filter_Interface   $filter  

[ Top ]

method addPriority [line 348]

void addPriority( string $name, integer $priority)

Add a custom priority



Tags:

access:  public


Parameters:

string   $name   Name of priority
integer   $priority   Numeric priority

[ Top ]

method addWriter [line 397]

void addWriter( mixed $writer)

Add a writer. A writer is responsible for taking a log message and writing it out to storage.



Tags:

access:  public


Parameters:

mixed   $writer   Microsoft_Log_Writer_Abstract or Config array

[ Top ]

method getClassName [line 213]

string getClassName( array $config, string $type, string $defaultNamespace)

Get the writer or filter full classname



Tags:

return:  full classname
access:  protected


Parameters:

array   $config  
string   $type   filter|writer
string   $defaultNamespace  

[ Top ]

method log [line 288]

void log( string $message, integer $priority, [mixed $extras = null])

Log a message at a priority



Tags:

throws:  Microsoft_Log_Exception
access:  public


Parameters:

string   $message   Message to log
integer   $priority   Priority of message
mixed   $extras   Extra information to log in event

[ Top ]

method setEventItem [line 422]

void setEventItem( $name $name, $value $value)

Set an extra item to pass to the log writers.



Tags:

access:  public


Parameters:

$name   $name   Name of the field
$value   $value   Value of the field

[ Top ]

method _constructFilterFromConfig [line 156]

Microsoft_Log_Filter_Interface _constructFilterFromConfig( array $config)

Construct filter object from configuration array or Microsoft_Config object



Tags:

access:  protected


Parameters:

array   $config  

[ Top ]

method _constructFromConfig [line 180]

object _constructFromConfig( string $type, array $config, string $namespace)

Construct a filter or writer from config



Tags:

access:  protected


Parameters:

string   $type   'writer' of 'filter'
array   $config  
string   $namespace  

[ Top ]

method _constructWriterFromConfig [line 129]

Microsoft_Log_Writer_Abstract _constructWriterFromConfig( $config, array $spec)

Construct a writer object based on a configuration array



Tags:

access:  protected


Parameters:

array   $spec   config array with writer spec
   $config  

[ Top ]

method __call [line 253]

void __call( string $method, string $params)

Undefined method handler allows a shortcut:

$log->priorityName('message') instead of $log->log('message', Microsoft_Log::PRIORITY_NAME)




Tags:

throws:  Microsoft_Log_Exception
access:  public


Parameters:

string   $method   priority name
string   $params   message to log

[ Top ]


Class Constants

ALERT =  1

[line 37]


[ Top ]

CRIT =  2

[line 38]


[ Top ]

DEBUG =  7

[line 43]


[ Top ]

EMERG =  0

[line 36]


[ Top ]

ERR =  3

[line 39]


[ Top ]

INFO =  6

[line 42]


[ Top ]

NOTICE =  5

[line 41]


[ Top ]

WARN =  4

[line 40]


[ Top ]



Documentation generated on Wed, 18 May 2011 12:06:40 +0200 by phpDocumentor 1.4.3