@forgeframework/logging
v0.3.0
Published
Provides structured, high-performance logging for the Forge Framework.
Maintainers
Readme
@forgeframework/logging
Provides structured, high-performance logging for the Forge Framework.
Part of the Forge Framework — a TypeScript framework for backend microservices and web applications.
Installation
npm install @forgeframework/loggingUsage
import { LoggerFactory, LogLevel } from '@forgeframework/logging';
LoggerFactory.configure({
level: LogLevel.INFO,
formatter: 'json',
transports: [
{ type: 'console', level: LogLevel.DEBUG, formatter: 'pretty' },
{ type: 'file', path: './logs/app.log', rotation: { maxSize: '10mb', maxFiles: 5 } },
],
redactPaths: ['password', 'token'],
});
const logger = LoggerFactory.create('user-service');
logger.info('Service started', { port: 3000 });
logger.error('Failed to connect', new Error('ECONNREFUSED'), { host: 'db.local' });Documentation
Full API reference and guides: https://carbonforge.io/framework/docs/core/logging
(Documentation site launching soon.)
License
MIT © Carbon Forge
