Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZPBLog Class Reference

## Public Member Functions
| __construct ( $fileName="")
| close ()
| notice ( $notice)
| warning ( $warning)
| error ( $error)

## Static Public Member Functions
static | writeNotice ( $notice)
static | writeWarning ( $warning)
| writeError ( $error)
static | write ( $message, $type="")

## Public Attributes
| $LogFile

## Detailed Description

! eZCommon The eZPBLog class handles streaming of information to a log file.

The eZPBLog class enables simple logging of information to a log file. It enables you to have your error/warning messages in one place, so you can analyze later.

The log messages are divided into there types: notice, warning and error.

For simple messages you should use the static functions, if you're going to write alot of messages sequentially you should use the create object methods. Then you don't have the overhead of opening and closing the file each time.

Example

// include the class
include_once( "kernel/classes/eZPBLog.php" );
// Create a new log object.
// Since we do not provide an argument the LogFile is read
// from site.ini
$log = new eZPBLog();
// write out some notice, warning and error information.
$log->notice( "This is a notice." );
$log->warning( "This is a warning." );
$log->error( "This is an error." );
// Close the log. Since php lacs destructors we must clean up manually.
$log->close();
// A convenient function for simple use
eZPBLog::write( "A notice" );
eZPBLog::write( "A warning", "warning" );
eZPBLog::write( "An error", "error" );
// And three direct calls, you decide which is simpler to use
eZPBLog::writeNotice( "A notice" );
eZPBLog::writeWarning( "A warning" );
eZPBLog::writeError( "An error" );
eZPBLog
Definition: ezpblog.php:76
eZPBLog\writeNotice
static writeNotice( $notice)
Definition: ezpblog.php:166
eZPBLog\write
static write( $message, $type="")
Definition: ezpblog.php:202
eZPBLog\writeError
writeError( $error)
Definition: ezpblog.php:188
eZPBLog\writeWarning
static writeWarning( $warning)
Definition: ezpblog.php:177

Definition at line 75 of file ezpblog.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZPBLog::__construct | ( |  | $fileName = `""` | ) |

Creates a new eZPBLog object. Opens the log file in append mode. If no valid filename is given as argument the log file is read from the site.ini file.

Definition at line 82 of file ezpblog.php.

References $day, $fileName, $ini, $month, $timestamp, $today, $year, eZDateTime\addZero(), file_exists(), and eZPBFile\fopen().

## Member Function Documentation

## ◆ close()

eZPBLog::close | ( |  | ) |

Closes the log file.

Definition at line 127 of file ezpblog.php.

## ◆ error()

eZPBLog::error | ( |  | $error | ) |

Writes out an error to the log file.

Definition at line 155 of file ezpblog.php.

References $error, and $time.

## ◆ notice()

eZPBLog::notice | ( |  | $notice | ) |

Writes out a notice to the log file.

Definition at line 135 of file ezpblog.php.

References $time.

## ◆ warning()

eZPBLog::warning | ( |  | $warning | ) |

Writes out a warning to the log file.

Definition at line 145 of file ezpblog.php.

References $time, and $warning.

## ◆ write()

static eZPBLog::write | ( |  | $message,
|  |  | $type = `""`
| ) |  |
| static

A simple function for writing notice, warning of error messages to the log file.

This function defaults to notice if no type argument is given.

Definition at line 202 of file ezpblog.php.

References $message, and $type.

## ◆ writeError()

eZPBLog::writeError | ( |  | $error | ) |
| static

A simple static function for writing errors to the log file.

Definition at line 188 of file ezpblog.php.

References $error.

Referenced by eZTechRenderer\renderImage(), and eZEzRenderer\renderPage().

## ◆ writeNotice()

static eZPBLog::writeNotice | ( |  | $notice | ) |
| static

A simple static function for writing notices to the log file.

Definition at line 166 of file ezpblog.php.

Referenced by eZImage\createWatermark(), eZImageCategory\get(), eZTemplate\haltmsg(), and eZPBImageFile\scaleCopy().

## ◆ writeWarning()

static eZPBLog::writeWarning | ( |  | $warning | ) |
| static

A simple static function for writing warnings to the log file.

Definition at line 177 of file ezpblog.php.

References $warning.

Referenced by eZMySQLDB\array_query_append(), eZPostgreSQLDB\array_query_append(), eZBackslashImporter\news(), eZNyheterNOImporter\news(), eZRDFImporter\news(), and eZRSSImporter\news().

## Member Data Documentation

## ◆ $LogFile

eZPBLog::$LogFile

Definition at line 240 of file ezpblog.php.

The documentation for this class was generated from the following file:

- ezpblog.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.