@gus-eip/loggers
v3.7.1
Published
@gus-eip/loggers is a package designed to provide logging functionality for your Node.js applications.
Downloads
1,333
Readme
@gus-eip/loggers
Overview
@gus-eip/loggers
is a package designed to provide logging functionality for your Node.js applications. It offers integration with various logging services, including CloudWatchLogger.
Installation
You can install the package via npm:
npm install @gus-eip/loggers
Usage
To use the logger module in your application, follow these steps:
- Import
LoggerModule
from@gus-eip/loggers
inside your module.
import { LoggerModule } from '@gus-eip/loggers';
- Configure
LoggerModule
in your module by calling theforRoot
method.
LoggerModule.forRoot({
region: process.env.REGION,
logGroupName: process.env.LOGGER_LOG_GROUP_NAME,
options: 'CloudWatchLogger',
}),
Ensure you provide the necessary environment variables (REGION
and LOGGER_LOG_GROUP_NAME
) for configuration.
Configuration Options
region
: The AWS region where your CloudWatch logs are located.logGroupName
: The name of the log group where logs will be sent.options
: The options for the logger. Currently, only'CloudWatchLogger'
is supported.
Example
import { Module } from '@nestjs/common';
import { LoggerModule } from '@gus-eip/loggers';
@Module({
imports: [
LoggerModule.forRoot({
region: process.env.REGION,
logGroupName: process.env.LOGGER_LOG_GROUP_NAME,
options: 'CloudWatchLogger',
}),
],
})
export class AppModule {}
License
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to customize this README according to your specific package features, usage guidelines, and licensing terms.