Apache Zeta Components - high quality PHP components

Apache Zeta Components Manual :: Docs For Class ezcLogUnixFileWriter

EventLog::ezcLogUnixFileWriter

Class ezcLogUnixFileWriter

Writes the log messages to a file in a format that is frequently used on the Unix operating system.

Source for this file: /EventLog/src/writers/writer_unix_file.php

ezcLogFileWriter
   |
   --ezcLogUnixFileWriter
Version:   //autogentag//

Inherited Member Variables

From ezcLogFileWriter
protected ezcLogFileWriter::$fileMap
protected ezcLogFileWriter::$logDirectory
protected ezcLogFileWriter::$maxFiles
protected ezcLogFileWriter::$maxSize
protected ezcLogFileWriter::$openFiles

Method Summary

protected string implodeWithKey( $splitEntry , $splitKeyVal , $data )
Returns a string from the hash $data.
public void writeLogMessage( $message , $eventType , $eventSource , $eventCategory , [ $extraInfo = array()] )
Write the logEntries to a file.

Inherited Methods

From ezcLogFileWriter
public ezcLogFileWriter ezcLogFileWriter::__construct()
Constructs an ezcLogFileWriter.
protected resource ezcLogFileWriter::openFile()
Returns the filehandle of the $fileName.
protected bool ezcLogFileWriter::rotateLog()
Rotates a log and returns true upon success.
public void ezcLogFileWriter::setFile()
Maps the filename $fileName to the messages specified by the ezcLogFilter $logFilter.
protected void ezcLogFileWriter::write()
This method writes the $string to a file.
public void ezcLogFileWriter::__destruct()
Destructs the object and closes all open file handles.

Methods

implodeWithKey

string implodeWithKey( string $splitEntry , string $splitKeyVal , array(mixed=>mixed) $data )

Returns a string from the hash $data.

The string $splitEntry specifies the string that will be inserted between the pairs. The string $splitKeyVal specifies the string that will be inserted in each pair.

Example:

  1.  $this->implodeWithKey( ", ", ": ", array( "Car" => "red", "Curtains" => "blue" );

Will create the following string:

 Car: red, Curtains: blue
Parameters:
Name Type Description
$splitEntry string
$splitKeyVal string
$data array(mixed=>mixed)

writeLogMessage

void writeLogMessage( string $message , int $eventType , string $eventSource , string $eventCategory , [array(string=>string) $extraInfo = array()] )

Write the logEntries to a file.

Each line in the log file represents a log message. The log messages have the following style:

 MMM dd HH:mm:ss [Severity] [Source] [Category] Message (ExtraInfo)

With:

  • MMM: The 3 letter abbreviation of the month.
  • dd: The day of the month.
  • HH: The hour.
  • mm: The minutes.
  • ss: The seconds.
Example:
 Jan 24 15:32:56 [Debug] [Paynet] [Shop] Connecting to the paynet server (file: paynet_server.php, line: 224).
 Jan 24 15:33:01 [Debug] [Paynet] [Shop] Connected with the server (file: paynet_server.php, line: 710).

This method will be called by the ezcLog class. The $eventSource and $eventCategory are either given in the ezcLog::log() method or are the defaults from the ezcLog class.

Parameters:
Name Type Description
$message string
$eventType int
$eventSource string
$eventCategory string
$extraInfo array(string=>string)
Documentation generated by phpDocumentor 1.4.3