This class contains the file writer class for the logging mechanism.

 Methods

Constructor of the writer instance.

__construct(array $options) 

Parameters

$options

array

Array with options for the writer instance (optional)

Factory method for a new writer instance.

factory(string $writerName, array $writerOptions) : \cLogWriter
InheritedStatic
inherited_from \cLogWriter::factory()

Parameters

$writerName

string

Name of the writer

$writerOptions

array

Options array for the writer instance

Exceptions

\cInvalidArgumentException if the writer class with the given name does not exist or is not an instance of clogWriter

Returns

\cLogWriterLog writer instance

Returns the value of an option entry.

getOption(string $option) : mixed
Inherited
inherited_from \cLogWriter::getOption()

Parameters

$option

string

Name of the option

Returns

mixedValue of the option entry

Returns an array with all options.

getOptions() : array
Inherited
inherited_from \cLogWriter::getOptions()

Returns

arrayArray with all options

Removes an option entry.

removeOption(string $option) : void
Inherited
inherited_from \cLogWriter::removeOption()

Parameters

$option

string

Name of the option

Sets a option.

setOption(string $option, mixed $value, boolean $force) : void
Inherited

If option was set previously, it must be forced to overwrite the value.

inherited_from \cLogWriter::setOption()

Parameters

$option

string

Name of the option

$value

mixed

Value of the option

$force

boolean

Flag to force setting the option value (optional, default: false)

Sets the whole options array.

setOptions(array $options) : void
Inherited
inherited_from \cLogWriter::setOptions()

Parameters

$options

array

Array with options

Writes the content to file handle.

write(string $message, int $priority) : boolean

This method must be implemented in the specific writer.

Parameters

$message

string

Message to write

$priority

int

Priority of the log entry

Returns

booleanState of the write process

Checks destination and creates the handle for the write process.

_createHandle() : void

Exceptions

\cException if not destination is specified
\cFileNotFoundException if the destination file could not be read

 Properties

 

Destination handle

$_handle : resource
 

Contains all options of the current writer instance.

$_options : array
Inherited
inherited_from \cLogWriter::$$_options