{"library":"simple-node-logger","title":"Simple Node Logger","description":"Simple Node Logger is a multi-level logging library for Node.js, providing robust support for console, file, and rolling file appenders. Currently at version 21.8.12, it offers flexible configuration options including custom timestamp formats, dynamic log level changes (trace, debug, info, warn, error, fatal), and the ability to integrate with process error events. Its key differentiators include a modular log manager for creating multiple loggers and appenders, support for domain and category columns in logs, and built-in statistics tracking for log statements. The library is designed for ease of use in small to large production environments, focusing on core logging functionalities without excessive complexity, and ships with TypeScript definitions for improved developer experience. While the documentation primarily shows CommonJS `require` patterns, it includes type definitions, suggesting compatibility with modern TypeScript setups.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install simple-node-logger"],"cli":null},"imports":["const log = require('simple-node-logger').createSimpleLogger();","const SimpleNodeLogger = require('simple-node-logger');\nconst log = SimpleNodeLogger.createSimpleLogger();","const { createRollingFileLogger } = require('simple-node-logger');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import * as simpleNodeLogger from 'simple-node-logger';\n\nconst opts = {\n    logFilePath: 'my_application.log',\n    timestampFormat: 'YYYY-MM-DD HH:mm:ss.SSS',\n    logDirectory: './logs', // Ensure this directory exists\n    fileNamePattern: 'roll-<DATE>.log',\n    dateFormat: 'YYYY.MM.DD'\n};\n\n// Create a custom logger with a rolling file appender and custom timestamp\nconst log = simpleNodeLogger.createRollingFileLogger(opts);\n\n// Set log level to 'info' at runtime\nlog.setLevel('info');\n\nlog.trace('This is a trace message.');\nlog.debug('This is a debug message.');\nlog.info('Application started at %s', new Date().toISOString());\nlog.warn('A non-critical warning occurred.');\nlog.error('An error happened: %o', new Error('Something went wrong'));\nlog.fatal('Application encountered a fatal error, shutting down.');","lang":"typescript","description":"Demonstrates setting up a rolling file logger with a custom timestamp format, setting the log level at runtime, and logging messages at various levels.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}