Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via pnpm

log4js 6.9.1

Port of Log4js to work with node.
Package summary
Share
0
issues
3
licenses
8
MIT
2
ISC
1
Apache-2.0
Package created
16 Jan 2011
Version published
8 Mar 2023
Maintainers
2
Total deps
11
Direct deps
5
License
Apache-2.0

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
8 Packages, Including:
date-format@4.0.14
debug@4.3.4
fs-extra@8.1.0
jsonfile@4.0.0
ms@2.1.2
rfdc@1.3.1
streamroller@3.1.5
universalify@0.1.2

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
flatted@3.3.1
graceful-fs@4.2.11

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
1 Packages, Including:
log4js@6.9.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

5
All Dependencies CSV
ⓘ This is a list of log4js 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
date-format4.0.145.6 kBMIT
prod
debug4.3.412.94 kBMIT
prod
flatted3.3.139.32 kBISC
prod
rfdc1.3.16.04 kBMIT
prod
streamroller3.1.511.71 kBMIT
prod

Visualizations

Frequently Asked Questions

What does log4js do?

Log4js is a popular npm package specifically designed to work with Node.js. It's a port of log4js, a comprehensive logging library, fine-tuned to work seamlessly with Node.js applications. Log4js allows developers to generate log files, providing colored console logging to stdout or stderr, file appender with log rolling based on file size or dates, logger for Connect/Express servers, configurable log message layouts/patterns, and the ability to set different log levels for different log categories. Additionally, it supports several optional appenders such as SMTP, GELF, Loggy, Logstash, logFaces, RabbitMQ, Redis, Hipchat, Slack, mailgun, and InfluxDB.

How do you use log4js?

To utilize Log4js in your JavaScript/Node.js projects, you will first have to install it via NPM using the command npm install log4js. Then, require it in your project file using var log4js = require("log4js");. A logger is then created with var logger = log4js.getLogger();. You can set the log level with logger.level = "debug"; (other levels are TRACE, INFO, WARN, ERROR, and FATAL), and finally, you can log a message with logger.debug("Some debug messages");.

For more complex usage, Log4js can be configured with different appenders and categories. For example:

const log4js = require("log4js");
log4js.configure({
  appenders: { cheese: { type: "file", filename: "cheese.log" } },
  categories: { default: { appenders: ["cheese"], level: "error" } },
});
const logger = log4js.getLogger("cheese");
logger.trace("Entering cheese testing");
logger.debug("Got cheese.");
logger.info("Cheese is Comté.");
logger.warn("Cheese is quite smelly.");
logger.error("Cheese is too ripe!");
logger.fatal("Cheese was breeding ground for listeria.");

In this example, the logger outputs to a file named 'cheese.log'.

Where are the log4js docs?

The full documentation for log4js can be found on the official log4js-node website. Additional information including migration guides for different versions and an example application can also be found on the website. The website provides details about the installation, usage, configuration, and the entire features set of Log4js.