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.
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.
- npm latestPublishedAt: No release in over 3.5 years
- peers Pino downloadsLast4Weeks: Pino is at 311M downloads and growing about 5x
- dev.to/devhelm/winston-vs-pino-choosing-a-nodejs-logger-in-2026-30ji: Current guides recommend Pino or winston for new projects
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.
- log4js-node.github.io/log4js-node/dateFile.html: Built-in rotation and compressed backups fit file-based deployments.
- github.com/fastify/fastify/blob/main/docs/Reference/Logging.md: Fastify uses Pino for JSON logging when logging is enabled.
- logtape.org/comparison: Current-version comparison favors Pino on Node.js console overhead.
- npm.latestPublishedAt, npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, peers, medianDownloadsRatio: Release cadence and relative download growth favor Pino.
- github.com/log4js-node/log4js-node/issues/1440: Users are still asking for a new release.
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.
- Node.js backend practice: Logging is a near-universal need for server apps
- pkgpulse.com/guides/pino-vs-winston-2026: Positioned for teams wanting log4j-style config
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.
- survey.stackoverflow.co/2025/technology?pubDate=20251202: Node.js has a large developer audience.
- log4js-node.github.io/log4js-node/categories.html: Categories control levels and output routing.
- raw.githubusercontent.com/log4js-node/log4js-node/v6.9.1/package.json: Browser mappings disable file appenders.
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.
- betterstack.com/community/guides/logging/best-nodejs-logging-libraries: Flexible appenders; no structured JSON by default
- github.com/log4js-node/log4js-node/issues: Open issues on bundling and multiFile, and users asking for a release
- npm hasTypes: Ships its own types
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.
- log4js-node.github.io/log4js-node/dateFile.html: Documents rotation, compression, and flushing on shutdown.
- log4js-node.github.io/log4js-node/layouts.html: Built-in text layouts and a custom formatting API.
- raw.githubusercontent.com/log4js-node/log4js-node/v6.9.1/types/log4js.d.ts: Ships types for the logger and its configuration.
- github.com/log4js-node/log4js-node/issues/1439: Next.js user reports a bundling error and receives a workaround.
- logtape.org/comparison: Pino leads on Node.js console output, while log4js fares well with no output.
- engineering.dept.global/in-praise-of-logging-a-node-js-javascript-logging-guide: Independent benchmark also finds higher overhead than Pino.
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.
- npm latestPublishedAt: Latest version 6.9.1, published 2023-03-08; 0 versions in the last year
- github commitsLastYear: 16 commits and 0 releases in the last year
- github.com/log4js-node/log4js-node/commits/master: June 2026 fixes merged but not released
- github.com/log4js-node/log4js-node/issues: Issue #1440 asks when a new version will be released
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.
- github.commitsLastYear, npm.latestPublishedAt, npm.versionsLastYear: Some repository activity and no recent package releases.
- github.com/log4js-node/log4js-node/issues/1440: Unresolved release request with follow-up in 2026.
- github.com/log4js-node/log4js-node/pulls: The 2024 bundler fix remains open alongside newer bot updates.
- peers: Pino and winston both shipped more recently.
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.
- betterstack.com/community/guides/logging/best-nodejs-logging-libraries: Listed among the top libraries, with no recommendation for new projects
- pkgpulse.com/guides/pino-vs-winston-2026: Mentioned only for log4j-style config
- chromium.googlesource.com/devtools/devtools-frontend/+/main/node_modules/log4js: Vendored in the Chromium DevTools node_modules
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.
- github.com/ether/etherpad/blob/develop/doc/privacy.md: Etherpad documents log4js access, HTTP, message, and console logging.
- docs.oracle.com/en/middleware/bi/analytics-server/administer-oas/administering-oracle-analytics-server.pdf: Oracle lists 6.9.1 in a tested Analytics Server setup.
- engineering.dept.global/in-praise-of-logging-a-node-js-javascript-logging-guide: Independent tests found a performance disadvantage.
- reddit.com/r/Nestjs_framework/comments/1mehtn6/what_is_best_logging_library_for_nodejs: A log4js user considers moving to Pino or winston.
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.
- github.com/advisories/GHSA-82v2-mx6x-wq7q: The disclosure records the fix in 6.4.0.
- raw.githubusercontent.com/log4js-node/log4js-node/v6.9.1/package.json: Confirms Apache-2.0 and five runtime dependencies.
- github.com/advisories/GHSA-rf6f-7fwh-wjgh: flatted 3.4.2 contains the fix and fits the declared range.
- scorecard.score, scorecard.checks: Security policy is present, with weak repository and workflow controls.
- advisories.last24Months, npm.latestPublishedAt: No recent direct advisory and a long gap since the last package release.
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.