Next: Full Syntax Description, Previous: Attribute Creation Functions, Up: Rewrite [Contents][Index]
A logging hook functions should be declared as follows:
Type of the request. It can be converted to string using
request_code_string function (see Rewrite Built-in Functions).
NAS identifier from raddb/naslist, or its host name if not declared there
Request identifier.
Notice that the hook function shall not produce any side effects, in particular it shall not modify the incoming request in any way.
Following is an example prefix hook function that formats the incoming request data:
string
compat_log_prefix(integer reqtype, string nas, integer id)
{
string result;
return "(" + request_code_string(reqtype) + " "
+ nas + " " + (string)id + " " + %[User-Name] + ")";
}
Here is a sample log produced by radiusd before and after
enabling this function:
Auth.notice: Login OK [jsmith] … Auth.notice: (AUTHREQ nas-2 251 jsmith): Login OK [jsmith] |