Skip to main content
Version: Next

LogClient

Client for accessing Actor run or build logs.

Provides methods to retrieve logs as text or stream them in real-time. Logs can be accessed for both running and finished Actor runs and builds.

@example
const client = new ApifyClient({ token: 'my-token' });
const runClient = client.run('my-run-id');

// Get the log content
const log = await runClient.log().get();
console.log(log);

// Stream the log in real-time
const stream = await runClient.log().stream();
stream.on('line', (line) => console.log(line));
@see

Hierarchy

  • ResourceClient
    • LogClient

Index

Properties

inheritedapifyClient

apifyClient: ApifyClient

inheritedbaseUrl

baseUrl: string

inheritedhttpClient

httpClient: HttpClient

optionalinheritedid

id?: string

optionalinheritedparams

params?: Record<string, unknown>

inheritedpublicBaseUrl

publicBaseUrl: string

inheritedresourcePath

resourcePath: string

optionalinheritedsafeId

safeId?: string

inheritedurl

url: string

Methods

get

  • get(options): Promise<undefined | string>

stream

  • stream(options): Promise<undefined | Readable>
  • Retrieves the log as a Readable stream. Only works in Node.js.

    @see

    Parameters

    Returns Promise<undefined | Readable>

    The log content as a Readable stream, or undefined if it does not exist.