Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@edirect/logger

Package Overview
Dependencies
Maintainers
26
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edirect/logger

<!-- https://simpleicons.org/ -->

latest
npmnpm
Version
11.0.32
Version published
Maintainers
26
Created
Source

 

@edirect/logger

The EDirectInsure Logger module.

Installation

$ npm i --save @edirect/logger

Usage

Import and register LoggerModule on AppModule (app.module.ts):

imports: [
  ...
  LoggerModule.register({
    output: "output",
    logs: {
    errorFile: "error_file",
    warningFile: "warning_file",
    infoFile: "info_file",
    },
    name: 'subscription-service',
  }),
  ...
]

OR

import { ConfigService } from '@edirect/config';

...

imports: [
  ...
  LoggerModule.registerAsync({
    imports: [ConfigModule],
    useFactory: async (configService: ConfigService) => ({
      output: configService.get(Variables.LOGS_OUTPUT),
      logs: {
        errorFile: configService.get(Variables.LOGS_ERROR_FILE),
        warningFile: configService.get(Variables.LOGS_WARNING_FILE),
        infoFile: configService.get(Variables.LOGS_INFO_FILE),
      },
      name: 'subscription-service',
    }),
    inject: [ConfigService],
  }),
  ...
]

Inject the LoggerService where needed:

constructor(
  private loggerService: LoggerService
) {}

Log using the exposed methods:

this.loggerService.log(message: string, payload?: string)
this.loggerService.info(message: string, payload?: string)
this.loggerService.warn(message: string, payload: string)
this.loggerService.error(message: string, trace: string)
this.loggerService.debug(message: string)
this.loggerService.verbose(message: string)

FAQs

Package last updated on 17 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts