Logging
FreshOverview
Use streamDeck.logger instead of console to ensure logs reach all targets including LOG files.
Log Levels
| Level | Use Case |
|---|---|
ERROR | Unrecoverable failures |
WARN | Potential issues |
INFO | General operational info |
DEBUG | Development diagnostics |
TRACE | Verbose debugging |
Default levels: Development = DEBUG, Production = INFO (DEBUG minimum).
Writing Logs
typescript
import streamDeck from "@elgato/streamdeck";
streamDeck.logger.error("Something broke");
streamDeck.logger.warn("Potential issue");
streamDeck.logger.info("Hello world");
streamDeck.logger.debug("Diagnostic info");
streamDeck.logger.trace("Verbose detail");Log File Format
<iso_date> <log_level> [[scope]: ]<message>Example: 2024-05-05T12:35:13.000Z INFO Hello world
File Rotation
- Retains 10 most recent log files (indexed 0-9, 0 = newest)
- Individual files capped at 10 MiB
- New files created on plugin start or when size limit exceeded
Scoped Loggers
Create child loggers for hierarchical identification:
typescript
const mainLogger = streamDeck.logger.createScope("Main");
mainLogger.info("Test"); // Output: Main: Test
const nestedLogger = mainLogger.createScope("Nested");
nestedLogger.info("Test"); // Output: Main->Nested: TestReading Logs
Plugin Logs
Located in the plugin's logs/ directory within .sdPlugin.
Stream Deck App Logs
| Platform | Path |
|---|---|
| Windows | %appdata%\Elgato\StreamDeck\logs\ |
| macOS | ~/Library/Logs/ElgatoStreamDeck/ |
StreamDeck0.log is always the most recent log file.