Skip to main contentLogging Configuration
Logging is essential for diagnosing Excel automation issues and monitoring AI workflows. X21 ships with logging on both the .NET and Deno sides, plus optional telemetry integrations.
VSTO Add-in (C#)
- Framework – Uses NLog (
vsto-addin\NLog.config).
- Default Targets
- File:
%LOCALAPPDATA%\X21\Logs\X21.log
- Optional console target when debugging via Visual Studio.
- Log Levels – Controlled via
appsettings.json under Logging.LogLevel. Production typically runs at Info, while development can use Debug.
- Custom Events – Key services (Excel API, TaskPane manager, PostHog service) log detailed messages about API calls, selection changes, and errors.
Deno Orchestrator
- Framework – Custom rotating file handler built atop the Deno standard
log module (src/utils/logger.ts).
- Directory –
%LOCALAPPDATA%\X21\X21-deno\Logs.
- Rotation Strategy – Writes to
deno-<machine>.log for the current day and archives previous days as deno-<machine>_YYYY-MM-DD.log.
- Configuration
DENO_ENV=development enables DEBUG level logging.
DENO_LOG_COLORS=false disables colour codes when piping logs.
DENO_CONSOLE_LOGS=false writes only to file (useful in production).
Langfuse Tracing
- Captures high-level metadata: prompt, user email, workbook, tool spans, compacting events, and user feedback.
- Accessible via the Langfuse dashboard; configure API keys as described in API Configuration.
- Use traces to correlate user reports with exact tool executions.
Viewing Logs
- Excel API logs—Open the folder displayed in the CLI or use the Windows Run dialog:
%LOCALAPPDATA%\X21\Logs.
- Deno logs—Navigate to
%LOCALAPPDATA%\X21\X21-deno\Logs. Files are plain text and easy to parse.
- ClickOnce publish logs—
publish\publish.log records output from Publish.ps1.
Best Practices
- Rotate or archive logs periodically to avoid disk bloat, especially on shared workstations.
- Mask sensitive data before sharing logs. Tool payloads can include workbook values or formulas.
- Align log levels across components—running the backend in DEBUG while the add-in is at INFO can make correlation difficult.
- Consider feeding logs into a central monitoring solution if you operate X21 at scale (e.g., ship to Azure Log Analytics or Splunk).
Proper logging shortens time-to-resolution when users encounter issues and provides the telemetry needed for continuous improvement.