Exponential Basic 2.4.0.1 Exponential Basic 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 20 of file ezlog.php.

## Member Function Documentation

## ◆ maxLogrotateFiles()

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

Returns
  the maximum number of logrotate files to keep.

Definition at line 156 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 128 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 178 of file ezlog.php.

References $fileName, $i, file_exists(), maxLogrotateFiles(), and eZFile\rename().

Referenced by eZScriptTrashPurge\run(), eZScriptClusterPurge\run(), write(), and writeStorageLog().

## ◆ setLogrotateFiles()

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

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

Definition at line 214 of file ezlog.php.

References $files.

Referenced by maxLogrotateFiles().

## ◆ setMaxLogSize()

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

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

Definition at line 147 of file ezlog.php.

References $size.

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 30 of file ezlog.php.

References $dir, $fileName, $ini, $time, file_exists(), maxLogSize(), eZDir\mkdir(), rotateLog(), and eZDebug\writeError().

Referenced by ezpContentAccessDeniedException\__construct(), ezpUserNotFoundException\__construct(), eZExecution\defaultExceptionHandler(), eZScriptClusterPurge\monitor(), eZScriptTrashPurge\monitor(), eZDFSFileHandler\startCacheGeneration(), and ezpAsynchronousPublisherLogOutput\write().

## ◆ writeStorageLog()

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

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

Definition at line 72 of file ezlog.php.

References $dir, $fileName, $ini, $name, $time, file_exists(), maxLogSize(), eZDir\mkdir(), rotateLog(), and eZDebug\writeError().

## Member Data Documentation

## ◆ MAX_LOGFILE_SIZE

const eZLog::MAX_LOGFILE_SIZE = 204800

Definition at line 23 of file ezlog.php.

Referenced by maxLogSize().

## ◆ MAX_LOGROTATE_FILES

const eZLog::MAX_LOGROTATE_FILES = 3

Definition at line 22 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+.