3.25.8. LogFormatHook Previous topic Parent topic Child topic Next topic

This specifies an optional Perl hook that runs for each log message when defined. By default, no hook is defined and LogFormat or the default format is used. The hook must return a single value. If the value is defined, it is used as the message to log. An undefined value causes the Log clause to return without logging. This allows LogFormatHook to function as a filter to suppress unwanted log messages.
The hook parameters are the following:
  • Message severity (integer)
  • Log message
  • Reference to the current request
  • Tracing identifier (string)
See goodies/logformat.cfg for a sample configuration file with JSON and CEF (ArcSight Common Event Format) formats.
Note
Consider installing Cpanel::JSON::XS or JSON::XS for higher performance JSON encoding.