CollaboKeys uses Winston for structured JSON logging. Every significant event — player connections, keypresses, server startup, and errors — is captured with a timestamp and written to rotating log files. Logs can also be viewed live in the admin panel or fetched via HTTP at any time.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tinkerer9/CollaboKeys/llms.txt
Use this file to discover all available pages before exploring further.
Log Levels
Winston log levels are ordered by descending severity. CollaboKeys uses the following levels:| Level | Severity | Examples |
|---|---|---|
error | Highest | Key emulation failure, accessibility helper crash |
warn | Wrong OS detected, display sleep preventer failed to start | |
info | Player keypress, username set, server started on port | |
http | Client connected, admin disconnected | |
verbose | Console command ran with full response text | |
debug | Internal state transitions | |
silly | Lowest | Fine-grained diagnostic output |
The logger is initialized at level
info, meaning http, verbose, debug, and silly messages are not written to file or displayed in the console by default unless you explicitly add a transport for that level via logs.logFileTypes.Log Files
Location
Log files are written to thelogs/ folder. The exact path depends on how CollaboKeys is running:
- Running from source (
npm start/npm test):logs/folder inside the project directory, i.e.<project root>/logs/ - Packaged as a
.app: macOSuserDatapath (typically~/Library/Application Support/CollaboKeys/logs/)
Default Log Files
By default, thelogs.logFileTypes array in config.json is ["combined", "error", "warn"], which produces three files:
| File | Level Filter | What’s inside |
|---|---|---|
error.log | error and above | Major failures — emulation errors, crashes |
warn.log | warn and above | Warnings and errors — minor issues and above |
combined.log | All levels (no filter) | Everything: errors, warnings, info, http, etc. |
Configuring Log Files
Log file behavior is controlled by two options inconfig.json:
logs.logFileTypes— array of level names and/or"combined". Each entry creates a corresponding<name>.logfile. Valid values:error,warn,info,http,verbose,debug,silly,combined. Unknown values are silently skipped.logs.deleteAtStart— set totrueto wipe the entirelogs/directory each time the server starts, giving you a fresh log on every session.
Raw Log Format
Each line written to a log file is a JSON object:HTTP Log Pages
Whenlogs.logPage.enabled is true (the default), CollaboKeys exposes log files over HTTP so they can be read from any browser or curl command without needing filesystem access.
Endpoints
| Path | Log File Served |
|---|---|
GET /logs | combined.log |
GET /logs/ | combined.log |
GET /logs/error | error.log |
GET /logs/warn | warn.log |
GET /logs/<name> | <name>.log (any valid log filename) |
Response Format
The HTTP endpoint returnstext/plain — not raw JSON. Each log entry is formatted for readability, with the level as a prefix and multi-line messages indented to align with the first line:
404 Responses
The/logs endpoint returns a 404 with a plain-text body in two situations:
- The requested log file does not exist on disk (e.g. you visit
/logs/debugbutdebugis not inlogs.logFileTypes). logs.logPage.enabledis set tofalseinconfig.json.
If the log file exists but is empty, the endpoint returns
200 with the body Logs empty rather than an empty response.Admin Panel Log Stream
The admin panel receives log messages in real time via Socket.IO. This is powered by theAdminPageTransport class in log.js, a custom Winston transport that emits a log Socket.IO event to all authenticated admins in the admin room whenever a new log entry is produced.
The transport is registered at the http level, so the admin panel receives http, info, warn, and error messages live.
Display Formatting
The admin panel applies visual styling based on log level:| Level | Admin Panel Appearance |
|---|---|
error | Entire message bolded and colored red, prefixed with ERROR: |
warn | Entire message bolded and colored red, prefixed with WARNING: |
| All others | Only the level prefix is bolded; message text is unstyled |
The admin panel log stream requires the admin page to be enabled (
adminPage.enabled: true). If the admin page is disabled, the AdminPageTransport is never registered and no Socket.IO log events are emitted.Console Output
In non-production environments (whenNODE_ENV is not set to "production"), log messages are also printed to stdout in your terminal. The console format is a compact single-line string: