Code Monkey home page Code Monkey logo

nestlogger's People

Contributors

dependabot[bot] avatar jukkahell avatar opportunityliu avatar sjkummer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nestlogger's Issues

Vulnerabilities found in nest-logger dependency

I found that warning, when i run npm audit command!
Does is critical?

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Incorrect Comparison in axios │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ axios │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.21.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ nest-logger │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ nest-logger > @nestjs/common > axios │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ GHSA-cph5-m8f7-6c5x
└───────────────┴──────────────────────────────────────────────────────────────┘

Options not passed to transport constructors

I just tried to extend your module with a level option for transports, which winston apparently supports.

Quickly found out that neither console nor rotate actually pass the supplied options to winston's transport constructors.

In case of console it's just empty:

public static console(options?: LoggerOptions): ConfiguredTransport {
...
    const transport = new winston.transports.Console();
...
}

In case of rotate some explicitly specified options are passed, the rest is discarded?

  public static rotate(options?: LoggerOptions): ConfiguredTransport {
    const defaultOptions = Object.assign({}, LoggerService.DEFAULT_LOGGER_OPTIONS);
    const fileLoggerOptions = Object.assign(defaultOptions, options);
    const transport = new DailyRotateFile({
...
      maxFiles: fileLoggerOptions.maxFiles,
      options: { flags: "a", mode: "0776" },
    });
    return { transport, options: fileLoggerOptions };
  }

Is there something I'm missing? For example, shouldn't console look something like the following?

  public static console(options?: LoggerOptions): ConfiguredTransport {
    const defaultOptions = Object.assign({}, LoggerService.DEFAULT_LOGGER_OPTIONS);
    const consoleLoggerOptions = Object.assign(defaultOptions, options);
    const transport = new winston.transports.Console(consoleLoggerOptions);
    return { transport, options: consoleLoggerOptions };
  }

Support nest Http request logging

Hi,
Thanks for this great library.
I hope if I can use LoggerService as an Interceptor for logging incoming Http Requests. Is there any built-in functionality for that purpose?
something like morgan

multiple log level

Hi,
is there a way to add multiple log levels to a single logger? something like this:
const logger = new LoggerService( 'info error warning', loggers, );

setContext does not work correct

export class SecurityService {
  constructor(
    private readonly logger: LoggerService
  ) {
    this.logger.setContext(`SecurityService`);
  }
}

export class SecurityService1 {
  constructor(
    private readonly logger: LoggerService
  ) {
    this.logger.setContext(`SecurityService1`);
  }
}

it alway get context is SecurityService

Example

Hi Can you please add an example how to import the LoggerService in any controller or service ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.