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
Huly Platform
Collaboration · Project Management · Team Chat
Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.
kopia
File Storage
Fast, encrypted, deduplicated backups to any cloud or local storage with full client-side control.
LobeHub
AI Assistants · Automation · Productivity
Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.
Logseq
Knowledge Management · Note Taking
A privacy-first, open-source knowledge graph platform combining Markdown, Org-mode, bidirectional linking, and local-first storage for building your second brain.
melty
AI Code Assistants · Code Editors · Developer Tools
The AI code editor where every chat message is a git commit you can revert, branch, or squash
OpenCode
AI Code Assistants
A fully open-source AI coding agent built for the terminal, with a TUI, desktop app, web client, plugin system, and SDK — one of the most-starred AI coding agents on GitHub.
paseo
AI Agents · AI Code Assistants
One unified interface to orchestrate Claude Code, Codex, Copilot, OpenCode, and Pi agents in parallel from desktop, mobile, or the terminal.
Responsively App
Design Tools · Developer Tools
Preview and interact with your responsive web design across every device size simultaneously — no more manual resizing.
Standard Notes
Note Taking
End-to-end encrypted notes and files — private by design, built to last, and fully self-hostable.