[options="header,autowidth"]
|===
-| Option | Description
-| file | Write to a file.
-| syslog | Send via the system's syslog() function.
-| file | Write to a file - NYI.
-| tcp | Write to a TCP socket.
-| udp | Write to a UDP socket.
-| unix | Write to a UNIX socket.
+| Option | Description
+| file | Write to a file.
+| request | Write to the logging destination of the current request
+| stdout | Write to stdout
+| stderr | Write to stderr
+| syslog | Send via the system's syslog() function.
+| tcp | Write to a TCP socket.
+| udp | Write to a UDP socket.
+| unix | Write to a UNIX socket.
|===
+The `stdout` and `stderr` destinations are likely to work only when
+the server is running in debug mode. When the server is running in
+background mode, both `stdout` and `stderr` are usually redirected
+to `/dev/null`.
+
.File as the destination for log messages.
linelog {
# delimiter = "\n"
format = "This is a log message for %{User-Name}"
- reference = "messages.%{&reply.Packet-Type || default}"
+ reference = "messages.%{&reply.Packet-Type || 'default'}"
messages {
default = "Unknown packet type %{Packet-Type}"
Access-Accept = "Sent accept: %{User-Name}"
filename = ${logdir}/linelog-accounting
permissions = 0600
}
- reference = "Accounting-Request.%{&Acct-Status-Type || unknown}"
+ reference = "Accounting-Request.%{&Acct-Status-Type || 'unknown'}"
Accounting-Request {
Start = "Connect: [%{User-Name}] (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} ip %{Framed-IP-Address})"
Stop = "Disconnect: [%{User-Name}] (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} ip %{Framed-IP-Address}) %{Acct-Session-Time} seconds"
#
# [options="header,autowidth"]
# |===
- # | Option | Description
- # | file | Write to a file.
- # | syslog | Send via the system's syslog() function.
- # | tcp | Write to a TCP socket.
- # | udp | Write to a UDP socket.
- # | unix | Write to a UNIX socket.
+ # | Option | Description
+ # | file | Write to a file.
+ # | request | Write to the logging destination of the current request
+ # | stdout | Write to stdout
+ # | stderr | Write to stderr
+ # | syslog | Send via the system's syslog() function.
+ # | tcp | Write to a TCP socket.
+ # | udp | Write to a UDP socket.
+ # | unix | Write to a UNIX socket.
# |===
#
+ # The `stdout` and `stderr` destinations are likely to work only when
+ # the server is running in debug mode. When the server is running in
+ # background mode, both `stdout` and `stderr` are usually redirected
+ # to `/dev/null`.
+ #
destination = file
#
typedef enum {
LINELOG_DST_INVALID = 0,
LINELOG_DST_FILE, //!< Log to a file.
+ LINELOG_DST_REQUEST, //!< Log to the request->log
LINELOG_DST_SYSLOG, //!< Log to syslog.
LINELOG_DST_UNIX, //!< Log via Unix socket.
LINELOG_DST_UDP, //!< Log via UDP.
static fr_table_num_sorted_t const linefr_log_dst_table[] = {
{ L("file"), LINELOG_DST_FILE },
+ { L("request"), LINELOG_DST_REQUEST },
{ L("stderr"), LINELOG_DST_STDERR },
{ L("stdout"), LINELOG_DST_STDOUT },
{ L("syslog"), LINELOG_DST_SYSLOG },
*/
case LINELOG_DST_INVALID:
case LINELOG_DST_FILE:
+ case LINELOG_DST_REQUEST:
case LINELOG_DST_SYSLOG:
case LINELOG_DST_STDOUT:
case LINELOG_DST_STDERR:
}
break;
+ case LINELOG_DST_REQUEST:
+ {
+ size_t i;
+
+ ret = 0;
+ for (i = 0; i < vector_len; i++) {
+ RINFO("%.*s", (int)vector_p[i].iov_len, (char *)vector_p[i].iov_base);
+ ret += vector_p[i].iov_len;
+ }
+ }
+ break;
+
case LINELOG_DST_UNIX:
if (fr_time_delta_ispos(inst->unix_sock.timeout)) {
timeout = inst->unix_sock.timeout;