Oihana PHP System

LoggerManager

AbstractYes

A logger manager.

Table of Contents

Constants

DEFAULT_EXTENSION  = '.log'
DEFAULT_NAME  = 'log'
DEFAULT_PATH  = 'log'
READ  = 'r'
WRITE  = 'w'

Properties

$directory  : string|mixed
The log directory.
$extension  : string|mixed
The extension of the logs files.
$name  : string|null
The name of the logging channel, a simple descriptive name that is attached to all log records.
$path  : string
The path of the log folder.

Methods

__construct()  : mixed
Creates a new MonoLogManager instance.
clear()  : bool
Clear the content of the specific file.
countLines()  : int
Returns the number of lines in a file.
createLog()  : array<string|int, mixed>|null
Create a basic log definition.
createLogger()  : LoggerInterface
getDirectory()  : string
Returns the log directory.
getExtension()  : string
Returns the extension of the log files.
getFileName()  : string
Returns the log file name.
getFilePath()  : string
Returns the full log path.
getLoggerFiles()  : array<string|int, mixed>|false
getLogLines()  : array<string|int, mixed>|null
Returns the list of lines of a specific log file.

Constants

Properties

$directory

The log directory.

public string|mixed $directory = \oihana\enums\Char::EMPTY

$extension

The extension of the logs files.

public string|mixed $extension

$name

The name of the logging channel, a simple descriptive name that is attached to all log records.

public string|null $name

Methods

__construct()

Creates a new MonoLogManager instance.

public __construct([string $directory = Char::EMPTY ][, array<string|int, mixed> $init = [] ][, string|null $name = null ]) : mixed
Parameters
$directory : string = Char::EMPTY
$init : array<string|int, mixed> = []
$name : string|null = null

clear()

Clear the content of the specific file.

public clear(string $file) : bool
Parameters
$file : string
Return values
bool

countLines()

Returns the number of lines in a file.

public countLines(string $file) : int
Parameters
$file : string

return int

Return values
int

createLog()

Create a basic log definition.

public createLog(string $line) : array<string|int, mixed>|null
Parameters
$line : string
Return values
array<string|int, mixed>|null

createLogger()

public abstract createLogger() : LoggerInterface
Return values
LoggerInterface

getDirectory()

Returns the log directory.

public getDirectory() : string
Return values
string

getExtension()

Returns the extension of the log files.

public getExtension() : string
Return values
string

getFileName()

Returns the log file name.

public getFileName() : string
Return values
string

getFilePath()

Returns the full log path.

public getFilePath() : string
Return values
string

getLoggerFiles()

public getLoggerFiles() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false

getLogLines()

Returns the list of lines of a specific log file.

public getLogLines(string $file) : array<string|int, mixed>|null
Parameters
$file : string
Return values
array<string|int, mixed>|null

        
On this page

Search results