This specifies an optional Perl hook that runs for each log
message when defined. The hook must return the formatted log message. By
default no hook is defined and SuccessFormat
and
FailureFormat
are used for formatting. The hook
parameters are the message severity level, the reason string, a reference
to the current request a tracing identifier string.
Here is an
example of using
LogFormatHook
:
# This auth logger logs both success and failure to a file in
# JSON format. The JSON Perl module must be installed.
<AuthLog FILE>
Identifier myauthlogger-json
Filename %L/authlog.json
LogFormatHook sub { Radius::LogFormat::format_authlog_json(@_); }
LogSuccess 1
LogFailure 1
</AuthLog>
For more examples, see
goodies/logformat.cfg
.
Note
Consider installing
Cpanel::JSON::XS
or JSON::XS
for
higher performance JSON encoding.