Elestia Open Source Ratings
4.4

log4js

Keep, but not for new work. 8th of 9 logging libraries.

log4js is a log4j-style logger for Node.js that routes logs through appenders and categories. Its last npm release was 6.9.1 in March 2023, and much of its install base comes from the deprecated Karma test runner. Keep it where it already runs. For new projects, Pino or winston is the better choice.

Best for: Teams that keep an existing log4js setup or want log4j-style appenders and categories in a Node.js service.

WebsiteGitHubnpm

Scores

Overall4.4

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 3.5, likely 2.5 to 4.5

log4js still works and is installed widely, mostly through Karma. But it has had no release since 2023, it lacks JSON-first output, and its share is falling fast. Pino and winston are maintained, faster or more flexible, and better validated, and LogTape is rising quickly. Keep it where it runs and choose a peer for new work.

GPT-6.2 Sol: 5.2, likely 4.0 to 6.4

Built-in file rotation and category routing make log4js a reasonable choice when those features are central to a Node.js deployment. Pino is the stronger default for new services because it offers JSON by default, lower measured output overhead, and a more active release cadence. Falling relative download share and unresolved release questions lower confidence in choosing log4js today.

Needed by many6.0

How many developers need a tool for this job?

Claude Opus 5.5: 6.0, likely 5.0 to 7.0

Most backend Node.js developers need a logger with levels and destinations. log4js covers Node only and leans toward log4j-style config, which narrows it a little compared with cross-runtime peers.

GPT-6.2 Sol: 5.9, likely 4.7 to 7.1

Leveled logging is a common need in Node.js services and tools. log4js is most relevant when developers want centralized routing or local log files, and its browser build omits the file appenders. The developer survey establishes the size of the Node.js audience, while demand for this style of logging is harder to quantify.

Helps a lot5.8

How well does it do the job for those who need it?

Claude Opus 5.5: 5.0, likely 4.0 to 6.0

The appender and category model is capable, and rolling file appenders work well. Structured JSON is not the default, and the library is slower than Pino. Fixes merged since 2023 have not shipped, so users still run 6.9.1 and its known bugs, such as the Next.js bundling issues. Pino and winston do the job better for most people.

GPT-6.2 Sol: 6.6, likely 5.4 to 7.7

Version 6.9.1 delivers flexible category routing, rolling files, and typed configuration with documented examples. JSON output takes extra setup, and users report bundling failures. Both outside benchmarks found higher output overhead than Pino, although log4js was competitive in LogTape’s no-output test. The range reflects differences between output paths and limited evidence on coding-agent accuracy.

Holds up over time3.3

Will it still be a good choice in two years?

Claude Opus 5.5: 3.0, likely 2.0 to 4.0

There has been no npm release for over three and a half years. A user asked in April 2025 when a new version would ship. A few people merged fixes in mid-2026 (16 commits in the last year), but nothing was published, and the Scorecard Maintained check is 0. Its main installer, Karma, is deprecated, so the ecosystem is moving away from it.

GPT-6.2 Sol: 3.5, likely 2.3 to 4.8

The repository recorded 16 commits in the past year, and npm has stayed on 6.9.1 since March 2023. A release request and a bundler fix are still open, while Pino and winston have published more recently. Continued repository activity leaves room for a return to regular releases, but the release request has no milestone or maintainer commitment.

Used widely5.8

How many use it, and is that growing?

Claude Opus 5.5: 5.0, likely 4.0 to 6.0

It has 35.8M downloads in the last 4 weeks and 770k dependent repos, but Karma pulls in much of that. Its growth ratio of 1.3 is far below the 4.1 median, so it is losing share fast to Pino, winston and newer loggers. Direct choices probably number in the tens of thousands and are shrinking.

  • npm downloadsLast4Weeks: 35.8M now vs 27.5M a year ago, a ratio of about 1.3 against a median of 4.1
  • dependents repos: 769,846 dependent repos, inflated by Karma
  • raw.githubusercontent.com/karma-runner/karma/master/package.json: Karma lists log4js ^6.4.1 as a runtime dependency
  • bluesky posts: No Bluesky or Hacker News attention

GPT-6.2 Sol: 6.5, likely 5.2 to 7.8

ecosyste.ms indexed about 770,000 dependent repositories, ahead of Pino and winston in this snapshot, and GitHub has about 5,800 stars. Four-week downloads rose from 27.5 million to 35.8 million, but the 1.31× ratio trails every listed peer and the 4.1× catalog median. That points to a large installed base losing relative ground. Transitive installs through Karma and limited recent discussion make the number of fresh direct choices hard to estimate.

  • dependents, github.stars: Large indexed footprint and substantial accumulated interest.
  • npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio, peers: Download growth trails all listed peers and the catalog baseline.
  • hackerNews.stories, bluesky.posts: The collector found no matching stories or repository links.
  • raw.githubusercontent.com/karma-runner/karma/v6.4.4/package.json: Karma installs log4js as a runtime dependency.
  • github.com/karma-runner/karma: Karma is deprecated, making it a weaker source of future adoption.
Vouched for4.4

Who stands behind it being good?

Claude Opus 5.5: 3.0, likely 2.0 to 5.0

Comparison guides still list it, but mostly as the log4j-style option. None recommends it for new work. It runs inside tools such as Karma and Chromium DevTools' build, but that is legacy use, not a current endorsement. There is no survey presence or recent independent benchmark.

GPT-6.2 Sol: 5.7, likely 4.5 to 6.9

Etherpad documents using log4js for server logging, and Oracle lists 6.9.1 among the tested dependencies for an Analytics Server deployment. Outside benchmarks show that results depend on the output path, with faster alternatives for console logging. Evidence of recent adoption and developer retention is thin, so the score rests mainly on documented use.

Safe5.5

How safe is it to depend on?

Claude Opus 5.5: 5.0, likely 4.0 to 6.0

It has one old moderate advisory, fixed in 2022, and only 5 dependencies under an Apache-2.0 licence. But a fix for a vulnerable flatted dependency was merged in June 2026 and never released, so the published package still carries it. The Scorecard is weak at 4.6, with 0 for branch protection, token permissions and maintenance.

  • advisories: One advisory (2022, moderate), none in the last 24 months
  • scorecard: Score 4.6; Branch-Protection, Token-Permissions and Maintained at 0
  • github.com/log4js-node/log4js-node/commits/master: Commit upgrading flatted to fix a vulnerability, not yet published
  • npm dependencies: 5 dependencies

GPT-6.2 Sol: 5.9, likely 4.6 to 7.2

The only recorded direct advisory was a moderate file-permission issue fixed in 6.4.0, and the package has a permissive Apache-2.0 license. It has five direct dependencies, including flatted, whose allowed range includes both versions affected by a 2026 advisory and the patched release. The 4.6 OpenSSF Scorecard flags weak branch protection, workflow token permissions, and dependency pinning. The long release gap and limited evidence about who can publish and how releases are verified widen the range.

Good

  • Appenders and categories send different logs to files, TCP or other targets from one config.
  • Built-in rolling file appenders, plus multiFile and runtime level changes.
  • Ships TypeScript types, carries an Apache-2.0 licence and pulls in only 5 dependencies.
  • Mature API that has been stable for years, with no advisories in the last 24 months.

Bad

  • No npm release since 6.9.1 in March 2023, and fixes merged in 2026 have not been published.
  • Output is not structured JSON by default, so JSON logs need a custom layout or an extra package.
  • Node-only and slower than Pino, with no browser or edge runtime support.
  • Much of its download count comes from the deprecated Karma test runner, not from direct choices.

The numbers

npm downloads, 4 weeks
36M +31% in a year
GitHub stars
5.8k
Commits, 12 months
16
npm version
6.9.1 Mar 2023
Versions, 12 months
0
Advisories, 24 months
0 of 1 ever
OpenSSF Scorecard
4.6 out of 10, Oct 2026
Licence
Apache-2.0

Read on 21 November 2026 from GitHub (log4js-node/log4js-node), npm (log4js), OSV and the OpenSSF Scorecard.

Logging libraries

  1. 8.7Pino
  2. 7.7LogTape
  3. 6.5tslog
  4. 6.3winston
  5. 5.9Consola
  6. 5.4loglevel
  7. 4.5debug
  8. 4.4log4js
  9. 3.4Bunyan
Compare all 9 on six scores