@gus-eip/loggers
TypeScript icon, indicating that this package has built-in type declarations

3.3.2 • Public • Published

@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:

  1. Import LoggerModule from @gus-eip/loggers inside your module.
import { LoggerModule } from '@gus-eip/loggers';
  1. Configure LoggerModule in your module by calling the forRoot 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.

Package Sidebar

Install

npm i @gus-eip/loggers

Weekly Downloads

196

Version

3.3.2

License

none

Unpacked Size

23.3 kB

Total Files

18

Last publish

Collaborators

  • jeyabaskar
  • sindhujaselvakumar