Structured, secure ESM logging for Node.js with redaction and defensive serialization, backed by Winston.
- Features
- Requirements
- Setup
- Usage
- Development
- Testing
- Troubleshooting
- Security
- API
- Packaging
- Examples
- Support
- Links
- License
@eliware/log provides structured logging for Node.js. It supports metadata redaction and defensive serialization.
- Use
createLogger()to create a Winston logger. - Import the default
loglogger or the namedlogexport. - Use
safeSerialize()to serialize values safely. - Configure text or JSON output, timestamps, transports, and redaction keys.
See documentation, specifications, and examples.
- Use Node.js 26 or later.
- Use a native ESM project.
- Configure the logger in application code. The package has no required environment variables.
Install the package with npm:
npm install @eliware/logThe package version is 12.0.0. Check the npm package for the published version.
Create a logger and write a message with metadata:
import { createLogger } from "@eliware/log";
const logger = createLogger({ format: "json", timestamp: true });
logger.info("Example", { requestId: "demo" });Prerequisites: Node.js 26 and an ESM project with @eliware/log installed.
Command: node examples/basic/example.mjs.
Expected result: one local info log line with placeholder metadata.
See release notes for package changes.
Read AGENTS.md, documentation index, and specification index before you change the logger contract.
Source modules live under src/. Matching tests live under tests/.
Run npm ci to install the lockfile dependencies.
Run npm test for aggregate validation, coverage, lint, format, audit, type, and package checks.
Run npm run lint, npm run audit, npm run format:check, npm run typecheck, or npm run pack for focused checks.
Run npm run format to write formatted files. Use npm run format:check for a read-only check.
Use Node.js 26 or later. Internal source modules are not public package exports.
Invalid logger options raise a TypeError. Check the configuration guide and safety guide.
Do not log credentials, access tokens, private keys, or other sensitive values.
Set keys for known sensitive metadata. Redaction does not detect every sensitive value.
Review custom Winston transports before use.
The package exports createLogger(options), safeSerialize(value, options), a default logger, and named log.
Logger options include level, transports, format, timestamp, and keys.
Type declarations are in src/index.d.ts.
The package includes src/, docs/, README.md, AGENTS.md, LICENSE, RELEASE_NOTES.md, examples/, specs/, and .env.example.
Run npm run pack to check package contents.
Publication requires the Operations release handoff. The repository does not grant publication authority.
Read examples/README.md for prerequisites, commands, and expected results. Start with the basic example. It uses placeholder metadata and makes no external requests.
For help, questions, or to chat with the author and community, visit:


