3.113. <AcctLog SYSLOG>

This clause logs accounting requests to the syslog logging facility. You can define as many AcctLog SYSLOG clauses as you wish at the top level or within Realm or Handler clauses. Each clause can specify different logging conditions and a different log file.

3.113.1. Facility

The name of the syslog facility that will be logged to. The default is user.
# Log to the syslog facility called 'auth'
Facility auth

3.113.2. Priority

The syslog priority level that will be used for each log message. Default is info.
# Increase this logger priority to 'notice'
Priority notice

3.113.3. LogFormat

This string defines the format for success messages. You can use any special characters. For more information, see Section 3.3. Special formatters. The bind variables are replaced as follows:
  • %0: the result
  • %1: the reason string, usually this is empty if successful
  • %2: the tracing identifier string
The default value is:
LogFormat %l:%n:%{Acct-Session-Id}:%{Framed-IP-Address}:%{Calling-Station-Id}

3.113.4. LogSock

This optional parameter specifies what type of socket to use to connect to the syslog server. The possible values are:
  • native
  • eventlog
  • unix
  • inet
    This means that TCP is tried first, then UDP.
  • tcp
  • udp
  • stream
  • pipe
  • console
The default is to use the Sys::Syslog default of native, tcp, udp, unix, pipe, stream, console.
CAUTION
Due to limitations in the Sys::Syslog Perl module, if you have multiple <AuthLog SYSLOG>, <AcctLog SYSLOG> or <Log SYSLOG> clauses and if any one has LogSock defined, all of them must have LogSock defined.
Note
If you use TCP, we recommend you to define both LogHost and LogPort. If you have not defined LogPort and you see error "TCP service unavailable", this means Sys::Syslog is unable to find the destination port. To resolve this, either use LogPort to define the port or add syslog/tcp or syslogng/tcp definitions to /etc/services file. For more information about LogPort, see Section 3.26.10. LogPort.

3.113.5. LogPath

When LogSock is set to unix or stream or pipe, this optional parameter specifies the syslog path. Defaults to _PATH_LOG macro (if your system defines it).
LogPath /run/mysyslog/log.sock

3.113.6. LogPort

This optional parameter specifies an alternative TCP or UDP destination port on the syslog host. There is no default, which means Sys::Syslog chooses the port. Here is an example of using LogPort:
LogPort 5514
CAUTION
This parameter requires Sys::Syslog 0.28 or later.

3.113.7. LogIdent

This optional string parameter specifies an alternative ident name Sys::Syslog prepends to every syslog message. Defaults to the executable name used to run radiusd. Special formatters are supported. For more information, see Section 3.3. Special formatters
# Also log server farm instance number
LogIdent %h-%O

3.113.8. LogOpt

This optional parameter allows control over the syslog options passed to Sys::Syslog::openlog. LogOpt is a comma separated list of words from the set:
  • cons
  • ndelay
  • nofatal
  • nowait
  • perror
  • pid
As described in the Perl Sys::Syslog documentation.
Defaults to pid. Special characters are supported.
LogOpt pid,perror

3.113.9. LogHost

When LogSock is set to tcp or udp or inet, this optional parameter specifies the name or address of the syslog host. Defaults to the local host. Special formatters are supported. For more information, see Section 3.3. Special formatters
Note
The LogHost parameter is passed directly to Perl's Sys::Syslog module which will likely do a DNS query for each logged message. This can cause performance problems and high number of DNS requests with verbose log levels. It is recommended to not set LogSock and let the local syslog to do remote logging.
Note
Sys::Syslog does not support IPv6. To log over IPv6, leave LogSock unset and let the local syslog do remote logging over IPv6.
# Log to a remote host via syslog over udp:
LogSock udp
LogHost your.syslog.host.com

3.113.10. MaxMessageLength

This optional parameter specifies a maximum message length (in characters) for each message to be logged. If specified, each log message is truncated to the specified number of characters prior to logging. Defaults to 0, which means no truncation.