devel:event:logger_data_format
Table of Contents
LOGGER_DATA_FORMAT
- Description:
- Intercept or modify logging
- DefaultAction:
- Prepare the lines to be written
- Preventable:
- yes
- Added:
- 2022-01-22
This event is signalled by log() in inc/Logger.php when a new message is to be logged, handlers can use it to modify the message or change the log location.
Passed Data
The passed data is an associative array with the following keys:
facility (string)
– the logging facility eg.debug
ordeprecated
datetime (int)
– the current timestampmessage (string)
– the message to be loggeddetails (mixed)
– additional details to be logged, needs to be transformed into text before loggingfile (string)
– the file where the data to log was createdline (int)
– the line in the above file where the data to log was createdloglines (array)
– the actual lines to be logged. Empty in BEFORE, will be filled by Logger::formatLogLineslogfile (string)
– the location of the logfile the data will be written to
Data will only be logged if the loglines
in non-empty after the AFTER
action.
Plugins will probably want to do one of these things:
- change the log file location:
- register an AFTER handler, change the
logfile
event data
- do not use the built in logging but log somewhere else:
- register a BEFORE handler, prevent default and do your own logging
- add additional log info:
- register an AFTER handler, modify the
loglines
- modify the log format:
- register a BEFORE handler, prevent default, create the
loglines
array
See also
- Code related to this event used in any DokuWiki files, plugins and templates
devel/event/logger_data_format.txt · Last modified: 2022-01-22 09:08 by andi