DEV.co
Open-Source Observability · megahertz

electron-log

electron-log is a lightweight, dependency-free logging module for Electron, Node.js, and NW.js applications. It writes logs to platform-specific directories and supports multiple transports (console, file, IPC, remote) with minimal configuration.

Source: GitHub — github.com/megahertz/electron-log
1.5k
GitHub stars
137
Forks
JavaScript
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorymegahertz/electron-log
Ownermegahertz
Primary languageJavaScript
LicenseMIT — OSI-approved
Stars1.5k
Forks137
Open issues16
Latest releaseUnknown
Last updated2026-05-14
Sourcehttps://github.com/megahertz/electron-log

What electron-log is

A zero-dependency logging library providing structured log output to console and file transports, with support for log levels (error, warn, info, verbose, debug, silly), custom transports, hooks, scoping, and buffering. Requires Electron 13+ or Node.js 14+ (v5+); supports main process, renderer, and preload contexts via separate entry points.

Quickstart

Get the electron-log source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/megahertz/electron-log.gitcd electron-log# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Electron Desktop Applications

Primary use case; native support for main and renderer process logging with automatic IPC bridging and platform-appropriate log file paths.

Debugging Production Issues

File transport writes structured logs to OS-standard directories; remote transport enables centralized log collection for deployed applications.

Multi-Process Logging Coordination

IPC transport automatically captures main process logs in renderer DevTools console during development; customizable transport stacking for complex scenarios.

Implementation considerations

  • Initialize logger separately in main and renderer processes; use distinct entry points (electron-log/main, electron-log/renderer, electron-log/node) to avoid bundler issues.
  • File transport only available in main process; configure log paths via resolvePathFn if default OS directories are unsuitable for your app.
  • IPC transport disabled by default in production; enable explicitly if dev-mode logging must persist in released builds.
  • Custom transports are simple functions; validate remote endpoint availability before enabling remote transport in production.
  • Log levels default to 'silly' (most verbose); adjust console.level and file.level to prevent dev-mode verbosity in production builds.

When to avoid it — and what to weigh

  • Enterprise Structured Logging Requirements — No built-in support for complex formats (JSON-LD, syslog), audit trails, or compliance-grade retention policies. Custom transports required.
  • High-Volume Async Log Ingestion — File transport is synchronous by default; no batching, buffering optimization, or backpressure handling for remote endpoints documented.
  • Legacy Electron or Node.js — v5 requires Electron 13+ and Node.js 14+. Older runtimes must pin to v4, which is no longer actively developed.
  • Browser-Only Applications — Not applicable; Electron-specific module structure incompatible with standard web bundle targets without workarounds.

License & commercial use

Licensed under MIT License, a permissive OSI-approved license permitting use, modification, and distribution with minimal restrictions.

MIT License permits commercial use, modification, and distribution provided copyright notice and license text are retained. Suitable for proprietary Electron applications. No warranty or support guarantees; review license terms directly for liability constraints.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Logs written to user home directories by default (accessible to local user and privileged processes). Remote transport sends POST requests; ensure endpoint HTTPS/TLS validation. No mention of log sanitization; do not log secrets (API keys, passwords, tokens) without explicit filtering via transforms or hooks. File permissions on log directories inherit OS defaults; audit on multi-user systems.

Alternatives to consider

winston

General-purpose Node.js logger with extensive transports (Sentry, Loggly, etc.) and middleware support; heavier, more dependencies, steeper configuration; better for enterprise logging pipelines.

pino

High-performance, JSON-first Node.js logger optimized for streaming and structured logging; stronger for microservices and cloud-native apps; less tailored to Electron renderer/main split.

bunyan

Structured JSON logging for Node.js with strong operational tooling; heavier dependency footprint; mature but slower release cadence than electron-log.

Software development agency

Build on electron-log with DEV.co software developers

electron-log offers a simple, dependency-free foundation. Contact us to evaluate it for your desktop application needs or explore custom logging pipelines.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

electron-log FAQ

Can I use electron-log in production?
Yes. MIT license permits commercial use. However, verify that default log file locations (user home directories) comply with your privacy/compliance requirements, and disable IPC transport in production builds unless explicitly needed.
Does electron-log support structured (JSON) logging?
Not natively; format option and transforms allow custom JSON serialization via custom transport, but out-of-box output is human-readable text. Remote transport sends JSON POST body, but only wraps LogMessage object.
How do I capture logs from renderer process in main?
Enable IPC transport (default in dev mode). Renderer logs are automatically bridged to main process via IPC; main process then writes to file and console per configured transports.
What if I upgrade from v4 to v5?
Migration guide exists in docs/migration.md. Main change: requires Electron 13+ and Node.js 14+. Review changelog and test entry point imports (main/renderer/node) in your codebase.

Software developers & web developers for hire

DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If electron-log is part of your open-source observability roadmap, our team can implement, customize, migrate, and maintain it.

Ready to integrate structured logging into your Electron app?

electron-log offers a simple, dependency-free foundation. Contact us to evaluate it for your desktop application needs or explore custom logging pipelines.