woowabros / nestjs-library-config

A NestJS module for managing environment variables easily and securely.
https://www.npmjs.com/package/@nestjs-library/config
MIT License
63 stars 10 forks source link

[Question] how to disable Logger In onModuleInit #276

Closed youngsu5582 closed 6 months ago

youngsu5582 commented 8 months ago

Thank you about really good Proejct!! I also agree @nestjs/config is just use all ENV element ( not useful part env element )

But , I use this library and find one question

image

Code Link

This code make always logging with key and secret value

So , I want to know why design with always logging

I am currently a student studying, and I may not be well aware of complex situations, so I am asking this question. I would be grateful if you could kindly teach me with a good heart!

Suggestion

Make nest-library-config.ts , add Logging Option!

type INestConfig= {
    log : boolean;
}

export const NEST_CONFIG : INestConfig ={
    log:true
}
export default NEST_CONFIG;

then , checking this option.

try {
    // Import CONFIG FILE in project folder
    NEST_CONFIG = require('./nest-library-config').NEST_CONFIG;
} catch (error) {
    // If Not Exist File , Create Default Option.
    NEST_CONFIG = { log: true };
    // OR
    NEST_CONFIG = require('./nest-library-config').DEFAULT_CONFIG;
}

Thank you once again !! If I get the chance, I would like to think more deeply about it and even contribute to this projects

jiho-kr commented 8 months ago

Hi, @youngsu5582

I didn't want to create separate setting or magic words for logging.

I expect to control logging through Log level.

youngsu5582 commented 8 months ago

I understand I didn't want to create separate setting or magic words for logging. this syntax.

I think I can use Seperate Logger Class ( For using collect Logger , using nest application booting Logger )

Thank you for reply ! πŸ‘πŸ‘

youngsu5582 commented 8 months ago

It's not problem!!

Think Problem

I was simply planning to collect All Log when Nest Applicaton is Start & Running.

Then , I upload logging file in aws s3 for Archiving.

But , this case cause env also save in log file. So , I ask how to disable log!

As I said earlier , It can be solved with seperated logger class


Another Request

Video Link

In this video 42:50 ,

image

say provide function that generate README with all config. and , I found ConfigScanner is that feature being referred.

add config scanner section in README.md with how to use , sample image would be good point as it show the usefulness of this library! 😊

I'm sorry to bother you! Thx!!