Configure Syslog output

Adaxes can be configured to output log records to a Syslog server. This article describes how to enable the feature and customize Syslog settings.

Only Adaxes service administrators have the rights to change Syslog settings.

Enable Syslog output

  1. Launch Adaxes Administration console.

     How { #collapse1}
    • On the computer where Adaxes Administration console is installed, open Windows Start menu.

    • Click Adaxes Administration Console.

  2. In the Console Tree, expand the Adaxes service node (the icon represents service nodes).

  3. Right-click Logging and then click Properties in the context menu.

  4. Activate the Syslog tab.

  5. Select Enable Syslog output.

  6. Specify the Syslog server name.

    By default, Adaxes uses UDP port 514 to send Syslog messages.

Change Syslog settings

You can customize the following settings of Syslog messages sent by Adaxes:

 Facility code

By default, the facility code of Syslog messages sent by Adaxes is set to 1 (User-level messages). To change the facility code, use the below script. In the script:

  • $serviceHost – the host name of the computer where Adaxes service is installed.

  • $facilityCode – the facility code to set. To reset the facility code to default, set the variable to $null.

     Facility codes {id=facilityCodes}
    • Value

    • Description

    • 0

    • Kernel messages

    • 1

    • User-level messages (default value)

    • 2

    • Mail system

    • 3

    • System daemons

    • 4

    • Security/authentication messages

    • 5

    • Messages generated internally by syslog

    • 6

    • Line printer subsystem

    • 7

    • Network news subsystem

    • 8

    • UUCP subsystem

    • 9

    • Clock daemon

    • 10

    • Security/authentication messages

    • 11

    • FTP daemon

    • 12

    • NTP subsystem

    • 13

    • Log audit

    • 14

    • Log alert

    • 15

    • Scheduling daemon

    • 16

    • Local use 0

    • 17

    • Local use 1

    • 18

    • Local use 2

    • 19

    • Local use 3

    • 20

    • Local use 4

    • 21

    • Local use 5

    • 22

    • Local use 6

    • 23

    • Local use 7

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"
$facilityCode = 16

# Connect to the Adaxes service.
$ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$service = $ns.GetServiceDirectly($serviceHost)

# Prompt for credentials.
$credential = Get-Credential

# Bind to the 'Service Log' container.
$path = $service.Backend.GetConfigurationContainerPath("ServiceLog")
$serviceLog = $service.OpenObject($path, $credential.UserName, `
    $credential.GetNetworkCredential().Password, 0)

# Change the facility code.
if ($facilityCode -eq 1)
{
    $facilityCode = $null
}
$serviceLog.Put("adm-ServiceLogSyslogMessageFacility", $facilityCode)

$serviceLog.SetInfo()
 Severity level

By default, the severity level of Syslog messages sent by Adaxes is set to 6 (Informational) for operations that were completed successfully or suspended and 3 (Error) for failed operations. To change the severity level, use the below script. In the script:

  • $serviceHost – the host name of the computer where Adaxes service is installed.

  • $severityLevel – the severity level to set. To reset the severity level to default, set the variable to $null.

     Severity levels {id=nested}
    • Value

    • Description

    • 0

    • Emergency

    • 1

    • Alert

    • 2

    • Critical

    • 3

    • Error (default value)

    • 4

    • Warning

    • 5

    • Notice

    • 6

    • Informational (default value)

    • 7

    • Debug

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"
$severityLevel = 5

# Connect to the Adaxes service.
$ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$service = $ns.GetServiceDirectly($serviceHost)

# Prompt for credentials.
$credential = Get-Credential

# Bind to the 'Service Log' container.
$path = $service.Backend.GetConfigurationContainerPath("ServiceLog")
$serviceLog = $service.OpenObject($path, $credential.UserName, `
    $credential.GetNetworkCredential().Password, 0)

# Set messages severity level.
$serviceLog.Put("adm-ServiceLogSyslogMessageSeverity", $severityLevel)
$serviceLog.SetInfo()
 Size limit

By default, Syslog messages sent by Adaxes have no size limit. To set a limit, use the below script. If the limit is exceeded, the message will be truncated by Adaxes. In the script:

  • $serviceHost – the host name of the computer where Adaxes service is installed.

  • $sizeLimitBytes – the message size limit (in bytes) to set. For Syslog messages to have no size limit, set the variable to $null.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"
$sizeLimitBytes = 1024

# Connect to the Adaxes service.
$ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$service = $ns.GetServiceDirectly($serviceHost)

# Prompt for credentials.
$credential = Get-Credential

# Bind to the 'Service Log' container.
$path = $service.Backend.GetConfigurationContainerPath("ServiceLog")
$serviceLog = $service.OpenObject($path, $credential.UserName, `
    $credential.GetNetworkCredential().Password, 0)

# Set the message size limit.
$serviceLog.Put("adm-ServiceLogSyslogMessageSizeLimit", $sizeLimitBytes)
$serviceLog.SetInfo()

 Tag

By default, Syslog messages sent by Adaxes have no tag. To set a tag, use the below script. In the script:

  • $serviceHost – the host name of the computer where Adaxes service is installed.

  • $messageTag – the message tag to set. For Syslog messages to have no tag, set the variable to $null.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"
$messageTag = "Adaxes"

# Connect to the Adaxes service.
$ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$service = $ns.GetServiceDirectly($serviceHost)

# Prompt for credentials.
$credential = Get-Credential

# Bind to the 'Service Log' container.
$path = $service.Backend.GetConfigurationContainerPath("ServiceLog")
$serviceLog = $service.OpenObject($path, $credential.UserName, `
    $credential.GetNetworkCredential().Password, 0)

# Set the message tag.
$serviceLog.Put("adm-ServiceLogSyslogMessageTag", $messageTag)
$serviceLog.SetInfo()
 Encoding

By default, encoding of Syslog messages sent by Adaxes is UTF-8. To change the encoding, use the below script. In the script:

  • $serviceHost – the host name of the computer where Adaxes service is installed.

  • $messageEncoding – the message encoding to set. The variable can be set to the encoding name (e.g. ASCII), Windows code page number (e.g. 1251) or web name (e.g. iso-2022-jp). To reset encoding of Syslog messages to default, set the variable to $null.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"
$messageEncoding = "ASCII"

# Connect to the Adaxes service.
$ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$service = $ns.GetServiceDirectly($serviceHost)

# Prompt for credentials.
$credential = Get-Credential

# Bind to the 'Service Log' container.
$path = $service.Backend.GetConfigurationContainerPath("ServiceLog")
$serviceLog = $service.OpenObject($path, $credential.UserName, `
    $credential.GetNetworkCredential().Password, 0)

# Set message encoding.
if ($messageEncoding -eq "UTF-8")
{
    $messageEncoding = $null
}
$serviceLog.Put("adm-ServiceLogSyslogMessageEncoding", $messageEncoding)
$serviceLog.SetInfo()

View current settings

To view the current Syslog settings, use the below script. In the script, the $serviceHost variable specifies the host name of the computer where Adaxes service is installed.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"

# Connect to the Adaxes service.
$ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$service = $ns.GetServiceDirectly($serviceHost)

# Prompt for credentials.
$credential = Get-Credential

# Bind to the 'Service Log' container.
$path = $service.Backend.GetConfigurationContainerPath("ServiceLog")
$serviceLog = $service.OpenObject($path, $credential.UserName, `
    $credential.GetNetworkCredential().Password, 0)

# Facility code
try
{
    $facilityCode = $serviceLog.Get("adm-ServiceLogSyslogMessageFacility")
}
catch
{
    $facilityCode = "1 (default)"
}

# Severity level
try
{
    $severityLevel = $serviceLog.Get("adm-ServiceLogSyslogMessageSeverity")
}
catch
{
    $severityLevel = "3 for failed operations and 6 for other (default)"
}

# Size limit
try
{
    $sizeLimit = $serviceLog.Get("adm-ServiceLogSyslogMessageSizeLimit")
    $sizeLimitBytes = "$sizeLimit bytes"
}
catch
{
    $sizeLimitBytes = "no limit (default)"
}

# Message tag
try
{
    $messageTag = $serviceLog.Get("adm-ServiceLogSyslogMessageTag")
}
catch
{
    $messageTag = "no tag (default)"
}

# Message encoding
try
{
    $messageEncoding = $serviceLog.Get("adm-ServiceLogSyslogMessageEncoding")
    $messageEncodingName = [System.Text.Encoding]::GetEncoding($messageEncoding).EncodingName
}
catch
{
    $messageEncoding = "UTF-8 (default)"
}

# Output Syslog settings.
Write-Host "Facility code:" $facilityCode
Write-Host "Severity level:" $severityLevel
Write-Host "Size limit:" $sizeLimitBytes
Write-Host "Message tag:" $messageTag
Write-Host "Message encoding:" $messageEncodingName