Class Zend_Log_Adapter_File

Description

Implements interfaces:

Located in /Zend/Log/Adapter/File.php (line 39)


	
			
Variable Summary
 string $_accessMode
 array $_buffer
 string $_filename
 +resource $_fileResource
 string $_lineEnding
 array $_options
Method Summary
 Zend_Log_Adapter_File __construct (mixed $filename, [mixed $accessMode = 'a'])
 void __destruct ()
 bool close ()
 bool flush ($message 0, $level 1)
 bool open ([$optionKey $filename = null], [$optionValue $accessMode = 'a'])
 bool setOption ($optionKey $optionKey, $optionValue $optionValue)
 bool write ($message $fields, $level 1)
 string _parseLogLine (mixed $fields, string $message, int $level)
 bool _setAccessMode ($accessMode $accessMode)
Variables
string $_accessMode = '' (line 63)

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

  • access: private
array $_buffer = array() (line 79)

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

  • access: private
string $_bufferedLines = 0 (line 87)

Number of lines in the buffer

  • access: private
string $_filename = '' (line 55)

Filename on the filesystem where the log file is stored.

  • access: private
+resource $_fileResource = null (line 47)

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

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

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

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

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: private
Methods
Constructor __construct (line 112)

Class Constructor

  • var: Name of the file on the filesystem to write the log.
  • access: public
Zend_Log_Adapter_File __construct (mixed $filename, [mixed $accessMode = 'a'])
Destructor __destruct (line 125)

Class Destructor

Always check that the file has been closed and the buffer flushed before destruction.

  • access: public
void __destruct ()
close (line 279)

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 241)

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
open (line 176)

Sets an option specific to the implementation of the log adapter.

  • return: True
  • access: public
bool open ([$optionKey $filename = null], [$optionValue $accessMode = 'a'])
  • $optionKey $filename: Key name for the option to be changed. Keys are adapter-specific
  • $optionValue $accessMode: New value to assign to the option
setOption (line 158)

Sets an option specific to the implementation of the log adapter.

  • return: True
  • access: public
bool setOption ($optionKey $optionKey, $optionValue $optionValue)
  • $optionKey $optionKey: Key name for the option to be changed. Keys are adapter-specific
  • $optionValue $optionValue: New value to assign to the option
write (line 202)

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 $fields, $level 1)
  • $level 1: Log level, one of Zend_Log::LEVEL_* constants
  • $message $fields: Log message
_parseLogLine (line 225)

Format a line before sending into the storage.

  • access: protected
string _parseLogLine (mixed $fields, string $message, int $level)
  • string $message
  • int $level
_setAccessMode (line 138)

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

Documentation generated on Tue, 18 Apr 2006 11:55:00 -0700 by phpDocumentor 1.3.0RC3