Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Static Public Member Functions | Public Attributes | Static Private Member Functions | List of all members
eZLog Class Reference
Utility classes

## Static Public Member Functions
static | write ( $message, $logName='common.log', $dir='var/log')
static | maxLogSize ()
static | setMaxLogSize ( $size)
static | maxLogrotateFiles ()
static | rotateLog ( $fileName)
static | setLogrotateFiles ( $files)

## Public Attributes
const | MAX_LOGROTATE_FILES = 3
const | MAX_LOGFILE_SIZE = 204800

## Static Private Member Functions
static | writeStorageLog ( $name, $dir=false)

## Detailed Description

Definition at line 19 of file ezlog.php.

## Member Function Documentation

## ◆ maxLogrotateFiles()

static eZLog::maxLogrotateFiles | ( |  | ) |
| static

Returns
  the maximum number of logrotate files to keep.

Definition at line 169 of file ezlog.php.

References MAX_LOGROTATE_FILES, and setLogrotateFiles().

Referenced by rotateLog().

## ◆ maxLogSize()

static eZLog::maxLogSize | ( |  | ) |
| static

Returns
  the maximum size for a log file in bytes.

Definition at line 141 of file ezlog.php.

References MAX_LOGFILE_SIZE, and setMaxLogSize().

Referenced by write(), and writeStorageLog().

## ◆ rotateLog()

static eZLog::rotateLog | ( |  | $fileName | ) |
| static

Rotates logfiles so the current logfile is backed up, old rotate logfiles are rotated once more and those that exceed maxLogrotateFiles() will be removed. Rotated files will get the extension .1, .2 etc.

Definition at line 191 of file ezlog.php.

References maxLogrotateFiles(), and eZFile\rename().

Referenced by write(), and writeStorageLog().

## ◆ setLogrotateFiles()

static eZLog::setLogrotateFiles | ( |  | $files | ) |
| static

Sets the maximum number of logrotate files to keep to $files.

Definition at line 227 of file ezlog.php.

Referenced by maxLogrotateFiles().

## ◆ setMaxLogSize()

static eZLog::setMaxLogSize | ( |  | $size | ) |
| static

Sets the maximum size for a log file to $size.

Definition at line 160 of file ezlog.php.

Referenced by maxLogSize().

## ◆ write()

static eZLog::write | ( |  | $message,
|  |  | $logName = `'common.log'`,
|  |  | $dir = `'var/log'`
| ) |  |
| static

Writes a message $message to a given file name $name and directory $dir for logging

Definition at line 29 of file ezlog.php.

References maxLogSize(), eZDir\mkdir(), rotateLog(), and eZDebug\writeError().

Referenced by eZExecution\defaultExceptionHandler(), and eZAudit\writeAudit().

## ◆ writeStorageLog()

static eZLog::writeStorageLog | ( |  | $name,
|  |  | $dir = `false`
| ) |  |
| static private

Writes file name $name and storage directory $dir to storage log

Definition at line 85 of file ezlog.php.

References maxLogSize(), eZDir\mkdir(), rotateLog(), and eZDebug\writeError().

Referenced by eZHTTPFile\store().

## Member Data Documentation

## ◆ MAX_LOGFILE_SIZE

const eZLog::MAX_LOGFILE_SIZE = 204800

Definition at line 22 of file ezlog.php.

Referenced by maxLogSize().

## ◆ MAX_LOGROTATE_FILES

const eZLog::MAX_LOGROTATE_FILES = 3

Definition at line 21 of file ezlog.php.

Referenced by maxLogrotateFiles().

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

- ezlog.php

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