Skip to main content

Get Logs

The getLogs() method on the LMChatClient allows you to retrieve all logs stored in the local database.

Steps to Retrieve Logs

  1. Use the getLogs() method on the LMChatClient instance.
  2. The method fetches all stored logs and returns them.
  3. The logs contain details such as timestamp, stack trace, SDK metadata, and severity level.

Example Usage

const logs = await lmChatClient?.getLogs();
console.log(logs); // Logs stored in Realm DB;

Get Logs Response

VariableTypeDescription
timestampnumberThe time when the log was created.
stackTraceLMStackTraceContains exception and trace details.
sdkMetaLMSDKMetaContains SDK version details (coreVersion, dataLayerVersion).
severityLMSeverityThe severity level of the log (INFO, ERROR, etc.).