W3cLogger

Extends \Joomla\CMS\Log\Logger\FormattedtextLogger

Joomla! W3C Logging class

This class is designed to build log files based on the W3C specification.

link

https://www.w3.org/TR/WD-logfile.html

since

1.7.0

Methods

__construct

Constructor.

__construct(array &$options) 
inherited
since

3.0.1

Arguments

$options

array

__destruct

If deferred, write all pending logs.

__destruct() 
inherited
since

3.9.0

addEntry

Method to add an entry to the log.

addEntry(\Joomla\CMS\Log\LogEntry $entry) : void
inherited abstract
since

3.0.1

throws

\RuntimeException

Arguments

$entry

\Joomla\CMS\Log\LogEntryThe log entry object to add to the log.

formatLine

Format a line for the log file.

formatLine(\Joomla\CMS\Log\Logger\JLogEntry $entry) : String
inherited
since

3.9.0

Arguments

$entry

\Joomla\CMS\Log\Logger\JLogEntryThe log entry to format as a string.

Response

String

generateFileHeader

Method to generate the log file header.

generateFileHeader() : string
inherited
since

1.7.0

Response

stringThe log file header

initFile

Method to initialise the log file. This will create the folder path to the file if it doesn't already exist and also get a new file header if the file doesn't already exist. If the file already exists it will simply open it for writing.

initFile() : void
inherited
since

1.7.0

throws

\RuntimeException

parseFields

Method to parse the format string into an array of fields.

parseFields() : void
inherited
since

1.7.0

Properties

format

The format which each entry follows in the log file.

inherited

All fields must be named in all caps and be within curly brackets eg. {FOOBAR}.

since

1.7.0

Type(s)

string

fields

The parsed fields from the format string.

inherited
since

1.7.0

Type(s)

array

path

The full filesystem path for the log file.

inherited
since

1.7.0

Type(s)

string

defer

If true, all writes will be deferred as long as possible.

inherited

NOTE: Deferred logs may never be written if the application encounters a fatal error.

since

3.9.0

Type(s)

boolean

deferredEntries

If deferring, entries will be stored here prior to writing.

inherited
since

3.9.0

Type(s)

array

options

Options array for the JLog instance.

inherited
since

3.0.1

Type(s)

array

priorities

Translation array for LogEntry priorities to text strings.

inherited
since

3.0.1

Type(s)

array