## Logging and Monitoring

The _Logging and Monitoring_ functions help you monitor and debug a conversation. They let you log messages and track token usage.

## [`log`](https://docs.cognigy.com/ai/for-developers/function-reference/logging/log)
**Syntax:** `log(level, message)` Writes a log entry to the execution logs.

## [`getLLMTokenUsageForSession`](https://docs.cognigy.com/ai/for-developers/function-reference/logging/getLLMTokenUsageForSession)
**Syntax:** `getLLMTokenUsageForSession()` Retrieves the token usage information for the conversation session. Returns `null` if no token usage information is available.

## [`setSensitiveLoggingSettings`](https://docs.cognigy.com/ai/for-developers/function-reference/logging/setSensitiveLoggingSettings)
**Syntax:** `setSensitiveLoggingSettings(settings)` Adjusts the masking and redaction configuration for the conversation.

Last modified on April 21, 2026.
