Class Zend_Log_Writer_File

Description
  • license: New BSD License
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)

Located in /Log/Writer/File.php (line 30)

Zend_Log_Writer_Abstract
   |
   --Zend_Log_Writer_File
Variable Summary
 string $_accessMode
 array $_buffer
 string $_filename
 +resource $_fileResource
 string $_lineEnding
 array $_options
Method Summary
 Zend_Log_Writer_File __construct ( $filename, [ $accessMode = 'a'])
 bool close ()
 bool flush ($message 0, $level 1)
 bool open ([$filename $filename = null], [$accessMode $accessMode = null])
 bool write ($message $message, $level $level)
 string _parseLogLine (string $message, int $level)
 bool _setAccessMode ($accessMode $accessMode)
Variables
string $_accessMode = '' (line 54)

PHP access mode of the file, either 'a'ppend or over'w'rite

  • access: protected
array $_buffer = array() (line 70)

Buffer, array of lines waiting to be written to the filesystem.

  • access: protected
string $_bufferedLines = 0 (line 78)

Number of lines in the buffer

  • access: protected
string $_filename = '' (line 46)

Filename on the filesystem where the log file is stored.

  • access: protected
+resource $_fileResource = null (line 38)

Holds the PHP resource for an open file, or null.

  • var: +null
  • access: protected
string $_lineEnding = "\n" (line 62)

Termination character(s) that are automatically appended to each line.

  • access: protected
array $_options = array('buffer' => false,
'bufferLines' => 20,
'keepOpen' => false,
'format' => '%message%, %level%')
(line 92)

Options: buffer True: use buffering False: no buffering, write immediately

bufferLines Maximum number of lines in the buffer

keepOpen True: keep file resource open between writes False: close the resource immediately after each write

  • access: protected

Redefinition of:
Zend_Log_Writer_Abstract::$_options

Inherited Variables

Inherited from Zend_Log_Writer_Abstract

Zend_Log_Writer_Abstract::$_filters
Methods
Constructor __construct (line 103)

Class Constructor

  • var: Name of the file on the filesystem to write the log.
  • access: public
Zend_Log_Writer_File __construct ( $filename, [ $accessMode = 'a'])
  • $filename
  • $accessMode
close (line 204)

Closes the file resource for the logfile. Calling this function does not write any buffered data into the log, so flush() must be called before close().

  • return: True
  • access: public
bool close ()
flush (line 167)

Write a message to the log. This function really just writes the message to the buffer.

  • return: True
  • access: public
bool flush ($message 0, $level 1)
  • $message 0: Log message
  • $level 1: Log level, one of Zend_Log::LEVEL_* constants

Redefinition of:
Zend_Log_Writer_Abstract::flush()
Flush the buffer to the storage.
open (line 117)

Opens the logfile for writing.

  • return: True
  • access: public
bool open ([$filename $filename = null], [$accessMode $accessMode = null])
  • $filename $filename: Filename to open
  • $accessMode $accessMode: Either "w"rite or "a"ppend
write (line 144)

Write a message to the log. This function really just writes the message to the buffer.

If buffering is enabled, the message won't hit the filesystem until the buffer fills or is flushed. If buffering is not enabled, the buffer will be flushed immediately.

  • return: True
  • access: public
bool write ($message $message, $level $level)
  • $message $message: Log message
  • $level $level: Log level, one of Zend_Log::LEVEL_* constants

Redefinition of:
Zend_Log_Writer_Abstract::write()
Buffer a message to be stored in the storage implemented by this writer.
_parseLogLine (line 222)

Format a line before sending into the storage.

  • access: protected
string _parseLogLine (string $message, int $level)
  • string $message
  • int $level
_setAccessMode (line 239)

Sets the access mode of the log file on the filesystem

  • return: True
  • access: protected
bool _setAccessMode ($accessMode $accessMode)
  • $accessMode $accessMode: Access mode: either 'a' append or 'w' overwrite

Inherited Methods

Inherited From Zend_Log_Writer_Abstract

 Zend_Log_Writer_Abstract::addFilter()
 Zend_Log_Writer_Abstract::flush()
 Zend_Log_Writer_Abstract::log()
 Zend_Log_Writer_Abstract::setOption()
 Zend_Log_Writer_Abstract::write()
 Zend_Log_Writer_Abstract::__destruct()

Documentation generated on Wed, 21 Feb 2007 12:02:30 -0800 by phpDocumentor 1.3.1