@algodomain/zlogger
v1.0.10
Published
A flexible, end-to-end traceable logger for Node.js/TypeScript projects, by Algodomain.
Maintainers
Readme
@algodomain/zlogger
A flexible, end-to-end traceable logger for Node.js/TypeScript projects, by Algodomain. Supports transaction ID tracking, colored output, file/REST/socket logging, and easy configuration.
Installation
npm install @algodomain/zloggerUsage
import logger, { configureLogger } from '@algodomain/zlogger';
logger.info('Hello world!');
logger.error('Something went wrong', { details: '...' });
// Optionally configure
configureLogger({
level: 'DEBUG',
outputs: ['console', 'file'],
filePath: './myapp.log',
maxFileSize: 1024 * 1024,
maxFiles: 5,
});Features
- Transaction ID tracking for end-to-end log traceability
- Console, file, REST, and socket outputs
- Log rotation for files
- Colorized output
- Easy configuration via environment or code
- Full TypeScript support (types included)
TypeScript Support
All types and interfaces are bundled. You get autocompletion and type safety out of the box.
Environment Variables
You can also configure via env vars:
ZLOGGER_LEVEL(e.g. DEBUG, INFO)ZLOGGER_OUTPUTS(comma-separated: console,file,rest,socket)ZLOGGER_FILE_PATH,ZLOGGER_MAX_FILE_SIZE,ZLOGGER_MAX_FILESZLOGGER_REST_URL,ZLOGGER_SOCKET_URL,ZLOGGER_BEARER_TOKEN
Example Output
[2025-07-08T08:01:47.831Z] [tx:123e4567] [INFO ] [app.ts:main:10] User login succeededLicense
ISC
