Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to import the winstonAzureBlob in nestjs application #11

Open
donats11 opened this issue Jul 30, 2023 · 1 comment
Open

Comments

@donats11
Copy link

donats11 commented Jul 30, 2023

Hi, I tried to use this package for nestjs application, but I got this error:
TS2740: Type 'WinstonAzureBlob' is missing the following properties from type 'TransportStream': writable, writableEnded, writableFinished, writableHighWaterMark, and 32 more.

These are my dependencies:
"winston": "^3.10.0",
"winston-azure-blob": "^1.4.0"

Is there something missing? Please let me know.

@agmoss
Copy link
Owner

agmoss commented Sep 20, 2023

Hi @donats11

Thanks for submitting this. I just threw this into a new nestjs app and I cannot replicate your issue. Can you share some more details or code related to you issue?

Here is a simple nestjs main.ts that works:

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import * as winston from "winston";
import { winstonAzureBlob, extensions } from "winston-azure-blob";

const logger = winston.createLogger({
  format: winston.format.combine(
      winston.format.timestamp(),
      winston.format.splat(),
      winston.format.json()
  ),
  transports: [
    winstonAzureBlob({
      account: {
        name: "*******",
        key: "*******"
      },
      blobName: "test",
      bufferLogSize : 1,
      containerName: "sample",
      eol : "\n",
      extension : extensions.LOG,
      level: "info",
      rotatePeriod : "YYYY-MM-DD",
      syncTimeout : 0,
    })
  ]
});


async function bootstrap() {
  logger.warn("Hello!");
  const app = await NestFactory.create(AppModule);
  await app.listen(3000);
}
bootstrap();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants