---
title: "Audit logs client"
slug: "audit-logs-client"
abstract: "Overview of Audit logs client used to query for audit logs information."
---
# Audit logs client

The Web SDK audit logs client allows you to query for audit logs information from the server.

## Query raw logs information

You can query raw logs information with the `QueryRawAsync` method, which returns a collection of `IRawAuditEntry`.

## Example

Query for entries with event type equals to `EntityUpdated` generated in the last five minutes.

```shell
var query = new RawAuditLogQuery
  {
    EventTypes = new[] {"EntityUpdated"},
    Take = 5,
    From = DateTime.UtcNow.AddMinutes(-5),
  };

var logs = await client.AuditLogs.QueryRawAsync(query).ConfigureAwait(false);

```

## Query business logs information

You can query business logs information with the `QueryBusinessAsync` method, which returns a collection of `IBusinessAuditEntry`.

## Example

Query for entries with type equals to `UserAudit`, sorted by `timestamp` in descending order.

```shell
var query = new BusinessAuditLogQuery
  {
    Sort = "timestamp",
    Order = QuerySortOrder.Desc,
    LogTypes = new[] {"UserAudit"},
  };

var logs = await client.AuditLogs.QueryBusinessAsync(query).ConfigureAwait(false);

```

## Query action logs information

You can query action logs information with the `QueryActionsAsync` method, which returns a collection of `IActionAuditEntry`.

## Example

Query for entries with action type equals to `ActionScript`.

```shell
var query = new ActionAuditLogQuery
  {
    ActionType = ActionType.ActionScript
  };

var logs = await client.AuditLogs.QueryActionAsync(query).ConfigureAwait(false);

```

## Query scripting logs information

You can query scripting logs information with the `QueryScriptingAsync` method, which returns a collection of `IScriptingAuditEntry`.

## Example

Query for entries with script name equals to `my.script` generated in the last five minutes.

```shell
var query = new ScriptingAuditLogQuery
  {
    ScriptName = "my.script",
    From = DateTime.UtcNow.AddMinutes(-3),
  };

var logs = await client.AuditLogs.QueryScriptingAsync(query).ConfigureAwait(false);

```

## Query trigger logs information

You can query trigger logs information with the `QueryTriggerAsync` method, which returns a collection of `ITriggerAuditEntry`.

## Example

Query for entries with execution type equals to `InProcess` and objective equals to `EntityCreation`.

```shell
var query = new TriggerAuditLogQuery
  {
    ExecutionType = ExecutionType.InProcess,
    Objective = AuditingTriggerObjective.EntityCreation,
  };

var logs = await client.AuditLogs.QueryTriggerAsync(query).ConfigureAwait(false);

```