View operation logs
All operations performed in Adaxes are logged in detail, and you can view who performed which operations, when, from which hosts, etc. In this tutorial, you will learn how to view Adaxes operation logs, integrate Adaxes into your Syslog infrastructure, and how to access log records using scripts.
To view the log of all operations performed via Adaxes, launch Adaxes Administration console, expand the Adaxes service node, and select Logging.
Log records will be displayed on the right.
You can filter the logs based on various parameters like date range, operation description, operation type, initiator type (Adaxes service or a user), initiator host.
Log records are kept for 30 days by default. You can change the default retention period.
You can view additional information for each operation. To do this, right-click a log record, and then click Properties in the context menu.
To view the log of operations performed by a specific user, right-click the user account, select All Tasks, and then click Management Activity in the context menu.
To view operations performed on an object, right-click the object, select All Tasks, and then click Management History in the context menu.
Reports
You can also use reports to view operation logs. Adaxes provides four built-in reports for log analysis:
-
Adaxes log – log of all operations performed in Adaxes.
-
Errors in Adaxes log – log of operations resulted in an error.
-
Management activity – log of operations performed by specific users.
-
Management history – log of operations performed on specific directory objects.
You can use the reports to view operation logs from the Web Interface.
For information on how to schedule reports, see Schedule reports.
Syslog
Adaxes logs can be integrated into a centralized logging system with the help of the Syslog protocol. To configure Adaxes to output log entries to an external Syslog server:
-
Right-click Logging, and then click Properties in the context menu.
-
Activate the Syslog tab.
-
Select the Enable Syslog output checkbox and specify the host name of your Syslog server.
For information on how to configure Syslog message settings, see Change syslog settings.
Scripts
It is possible to access Adaxes logs programmatically. The following PowerShell script outputs logs for the last 30 days:
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$numDays = 30 # set to 0 to output all records
$ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$service = $ns.GetServiceDirectly("localhost")
# Bind to General Log
$path = $service.Backend.GetConfigurationContainerPath("ServiceLog")
$serviceLog = $service.OpenObject($path.ToString(), $null, $null, 0)
$generalLog = $serviceLog.GeneralLog
if ($numDays -ne 0)
{
$generalLog.StartDateTime = (Get-Date).AddDays(-$numDays)
$generalLog.EndDateTime = Get-Date
}
# Get the log records
$log = $generalLog.Log
$records = $log.GetPage(0)
# Output the records
foreach ($record in $records)
{
Write-Host "Start Time:" $record.StartTime
Write-Host "Completion Time:" $record.CompletionTime
Write-Host "Initiator:" $record.Initiator.Name
Write-Host "Object:" $record.TargetObjectName
Write-Host "Object Type:" $record.TargetObjectType
Write-Host "Operation:" $record.Description
}
For more information and examples, see Accessing log records.