Back to Node Auth0

Class LogsClient

docs/classes/management.SDK.LogsClient.html

5.9.16.3 KB
Original Source

Class LogsClient

Index

Constructors

constructor

Methods

listget

Properties

_options

Constructors

constructor

new LogsClient(options: BaseClientOptions): LogsClient

Parameters

Returns LogsClient

Methods

list

list(
request?: ListLogsRequestParameters,
requestOptions?: LogsClient.RequestOptions,
): Promise<Page<Log, ListLogOffsetPaginatedResponseContent>>

Retrieve log entries that match the specified search criteria (or all log entries if no criteria specified).

Set custom search criteria using the q parameter, or search from a specific log ID ("search from checkpoint").

For more information on all possible event types, their respective acronyms, and descriptions, see Log Event Type Codes.

To set custom search criteria, use the following parameters:
  • q: Search Criteria using Query String Syntax
  • page: Page index of the results to return. First page is 0.
  • per_page: Number of results per page.
  • sort: Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1
  • fields: Comma-separated list of fields to include or exclude (depending on include_fields) from the result, empty to retrieve all fields.
  • include_fields: Whether specified fields are to be included (true) or excluded (false).
  • include_totals: Return results inside an object that contains the total result count (true) or as a direct array of results (false, default). Deprecated: this field is deprecated and should be removed from use. See Search Engine V3 Breaking Changes

For more information on the list of fields that can be used in fields and sort, see Searchable Fields.

Auth0 limits the number of logs you can return by search criteria to 100 logs per request. Furthermore, you may paginate only through 1,000 search results. If you exceed this threshold, please redefine your search or use the get logs by checkpoint method.

To search from a checkpoint log ID, use the following parameters:
  • from: Log Event ID from which to start retrieving logs. You can limit the number of logs returned using the take parameter. If you use from at the same time as q, from takes precedence and q is ignored.
  • take: Number of entries to retrieve when using the from parameter.

Important: When fetching logs from a checkpoint log ID, any parameter other than from and take will be ignored, and date ordering is not guaranteed.

Parameters

Request-specific configuration.

Returns Promise<Page<Log, ListLogOffsetPaginatedResponseContent>>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.logs.list({ page: 1, per_page: 1, sort: "sort", fields: "fields", include_fields: true, include_totals: true, search: "search" })Copy

get

get(
id: string,
requestOptions?: LogsClient.RequestOptions,
): HttpResponsePromise<GetLogResponseContent>

Retrieve an individual log event.

Parameters

  • id: string

log_id of the log to retrieve.

Request-specific configuration.

Returns HttpResponsePromise<GetLogResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.logs.get("id")Copy

Properties

Protected Readonly_options

_options: NormalizedClientOptionsWithAuth<BaseClientOptions>

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Constructors constructor Methods listget Properties _options