Logs

The Logs method allows all information that is neither an error nor an activity to be logged.

The Streply\Log method consists of 4 parameters:

function Log(
    string $message,
    array $params = [],
    ?string $channel = null,
    string $level = Level::NORMAL
): void

The Logs method allows all information that is neither an error nor an activity to be logged.

  • (string) $message - Name of the activity
  • (array) $params - Parameters
  • (?string) $channel - Activity channel (group)
  • (string) $level - Log importance
Streply\Log('users.export.failure');

For example, a failure message can be added as a parameter:

Streply\Activity('users.export.failure', ['message' => $message]);

Available importance levels:

  • Streply\Enum\Level::LOW
  • Streply\Enum\Level::NORMAL
  • Streply\Enum\Level::HIGH
  • Streply\Enum\Level::CRITICAL

Based on importance, we can set notifications and search criteria (e.g. show logs with a critical level).

Logs formatting

In logs, you can add special tags to better format logs in events explorer.

Name Example Result
Bold New message from **Michal** New message from Michal
Underline New message from user with title __Some title here__ New message from user with title Some title here
Link to search with keyword User extend his plan to {PREMIUM} User extend his plan to PREMIUM