electron-log
Zero-dependency logging for Electron, Node.js, and NW.js apps with file, console, and remote transports.
Repository Health
Technical Analysis
electron-log is a logging library purpose-built for Electron applications, though it works equally well in plain Node.js and NW.js. It ships with sensible defaults out of the box: logs are written simultaneously to the console and to a per-platform log file (~/Library/Logs/{app}/main.log on macOS, %USERPROFILE%\AppData\Roaming\{app}\logs\main.log on Windows, and the XDG config path on Linux), so developers get useful diagnostics from day one without writing any transport code.
Beyond the defaults, it offers separate entry points for the main, renderer, node, and preload contexts of an Electron app, a pluggable transport system (console, file, IPC, remote HTTP), scoped loggers, log buffering for conditional verbose output, and built-in handlers for catching unhandled errors and critical Electron process events. With zero runtime dependencies and 38 contributors over nearly a decade, it has become the de facto standard logger for the Electron ecosystem.
What You Get
- Separate, purpose-built entry points for main, renderer, node, and preload processes so each context gets correctly wired logging with zero manual IPC plumbing
- Built-in console, file, IPC, and remote-HTTP transports, each independently configurable by log level and message format, plus support for fully custom transport functions
- Automatic per-OS default log file locations (macOS, Windows, Linux) so file logging works immediately without configuration
- An error handler and event logger that automatically catch unhandled exceptions, rejected promises, and critical Electron events like render-process-gone or certificate-error
- Logging scopes and multiple named logger instances for separating output by module or subsystem, plus a buffering API for capturing verbose logs only when an operation fails
- First-class TypeScript typings and a hook system for transforming or filtering log messages before they reach a transport
Common Use Cases
- Capturing crash diagnostics and unhandled errors from an Electron app’s main process to a local log file for post-mortem debugging
- Forwarding renderer-process console output to the main process log file so all application logs live in one place regardless of which process produced them
- Sending critical errors from a deployed desktop application to a remote logging endpoint for centralized monitoring across many user machines
- Scoping logs per subsystem (e.g., ‘updater’, ‘auth’, ‘ipc’) to make multi-module desktop applications easier to debug in production
Under The Hood
Architecture electron-log is organized around a process-aware entry point: src/index.js detects whether it is running in the renderer, main, or plain Node.js/NW.js context and requires the matching implementation (main, renderer, or node). A shared core/Logger class implements the level system, hooks, and buffering, while process-specific modules (main/index.js, node/index.js, renderer/index.js) wire up the appropriate default transports and an IPC bridge between renderer and main. This separation keeps the renderer bundle free of Node-only code (like file-system access) while still presenting one consistent log.info/warn/error API everywhere.
Tech Stack The library is plain, dependency-free JavaScript with hand-written .d.ts typings shipped alongside the JS source rather than compiled from TypeScript, keeping the published package small and dependency-free. Development tooling includes ESLint (Airbnb config), a lightweight in-house test runner (humile), and Vite/Webpack configs used only for the e2e test fixtures, not the published library itself.
Code Quality The codebase is small and modular (core/main/node/renderer split, each under a few hundred lines), with unit specs colocated under __specs__ directories next to the code they test and a working CI test/lint pipeline. Long-running maintenance since 2016 (569 commits, 38 contributors) shows staying power, though recent commit frequency has slowed to roughly one per month.
API Design The public surface is deliberately minimal: log.info(), log.warn(), etc. mirror the familiar console API, transports are configured with simple property assignment (log.transports.file.level = false), and scopes/instances follow one consistent creation pattern (log.scope(), log.create()). This low-ceremony design is a major reason it remains the most widely adopted logger in the Electron ecosystem.
Used by 20 apps in this directory
AFFiNE
Productivity · Project Management · Note Taking
Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.
AionUi
AI Agents · Productivity
Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.
Amical
Note Taking · AI Assistants
Local-first AI dictation that understands your active app — private, offline, and built for speed.
anytype-ts
Knowledge Management · Note Taking · Collaboration
A local-first, end-to-end encrypted knowledge OS that lets you build notes, tasks, wikis, and entire apps — with your data stored offline and synced peer-to-peer.
Banana Slides
AI Design Tools · Productivity
AI-native PPT generator with Vibe editing, multi-LLM support, and fully editable PPTX export
Cate
AI Code Assistants
A desktop IDE built on an infinite canvas — spread code editors, terminals, browsers, docs, and AI agents across freeform space instead of stacking windows and tabs, with layouts restored automatically.
drawio-desktop
Design Tools · Productivity
The offline-first diagram editor that puts security above all else — no account, no data leaving your machine, no compromises.
Dyad
AI Development · Productivity · AI Code Assistants
Build AI-powered apps locally with your own keys, your own models, and zero cloud lock-in.
GDevelop
Developer Tools · Game Development · Design Tools
No-code, open-source game engine for building 2D, 3D and multiplayer games — publish to iOS, Android, Steam and the web.