FormattedtextLogger
Extends LoggerJoomla! Formatted Text File Log class
This class is designed to use as a base for building formatted text files for output. By default it emulates the Syslog style format output. This is a disk based output format.
since |
1.7.0 |
---|---|
package |
Joomla CMS |
Methods
__construct
Constructor.
__construct(array &options) : mixed
since |
3.0.1 |
---|
Arguments
- options
array
Log object options.
Response
mixed
__destruct
If deferred, write all pending logs.
__destruct() : mixed
since |
3.9.0 |
---|
Response
mixed
addEntry
Method to add an entry to the log.
addEntry(\Joomla\CMS\Log\LogEntry entry) : void
since |
3.0.1 |
---|---|
throws |
|
Arguments
- entry
\Joomla\CMS\Log\LogEntry
The log entry object to add to the log.
formatLine
Format a line for the log file.
formatLine(\Joomla\CMS\Log\LogEntry entry) : string
since |
3.9.0 |
---|
Arguments
- entry
\Joomla\CMS\Log\LogEntry
The log entry to format as a string.
Response
string
generateFileHeader
Method to generate the log file header.
generateFileHeader() : string
since |
1.7.0 |
---|
Response
string
The 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
since |
1.7.0 |
---|---|
throws |
|
parseFields
Method to parse the format string into an array of fields.
parseFields() : void
since |
1.7.0 |
---|
Properties
format
The format which each entry follows in the log file.
All fields must be named in all caps and be within curly brackets eg. {FOOBAR}.
since |
1.7.0 |
---|
Type(s)
string
defer
If true, all writes will be deferred as long as possible.
NOTE: Deferred logs may never be written if the application encounters a fatal error.
since |
3.9.0 |
---|
Type(s)
bool
deferredEntries
If deferring, entries will be stored here prior to writing.
priorities
Translation array for LogEntry priorities to text strings.