title: how to use winston logger in nest node in static classes
body: <p>I want to use <code>winston</code> logging module in my node application and I am using <code>nest</code> framework.</p>
  <p>So I installed</p>
  <pre><code>yarn add nest-winston
  yarn add winston
  </code></pre>
  <p>and in my <code>app.module.ts</code></p>
  <pre><code>WinstonModule.forRoot({
    format: winston.format.combine(
      winston.format.timestamp(),
      winston.format.json(),
    ),
    transports: [
      new winston.transports.File({
        dirname: process.env.LOG_FILE_PATH,
        filename: 'info.log',
        level: 'info',
      }),
      new winston.transports.File({
        dirname: process.env.LOG_FILE_PATH,
        filename: 'error.log',
        level: 'error',
      }),
    ],
  }),
  </code></pre>
  <p>and in my contrller file i can inject like this</p>
  <pre><code>constructor(@Inject(WINSTON_MODULE_NEST_PROVIDER) private readonly logger: LoggerService) { }
  </code></pre>
  <p>and this is working fine.</p>
  <p>Now I have <code>DB</code> class that is <code>static</code> with <code>static</code> methods. So there will be no <code>constructor</code>. So how can I inject in this case.</p>
  <p>And in my <code>main.ts</code> there is no class so in that too how can i get the <code>logger</code> instance.</p>