I am trying to upload my logs in the azure storage. I used the winstonAzureBlob library. But I am getting this error
'TS2740: Type 'WinstonAzureBlob' is missing the following properties from type 'TransportStream': writable, writableEnded, writableFinished, writableHighWaterMark, and 32 more.
ERROR in ./libs/server/shared/logger/src/lib/logger.util.ts:13:9
TS2740: Type 'WinstonAzureBlob' is missing the following properties from type 'TransportStream': writable, writableEnded, writableFinished, writableHighWaterMark, and 32 more.'
This worked fine in another new project that I made. When I use the code in my original project, I always have this error.
import * as winston from 'winston';
import { winstonAzureBlob } from 'winston-azure-blob';
import { utilities as nestWinstonModuleUtilities, WinstonModule } from 'nest-winston';
async function bootstrap() {
const formatter= winston.format.combine(
winston.format.timestamp(),
winston.format.printf(({ level, message, timestamp }) => {
return `${timestamp} [${level.toUpperCase()}]: ${message}`;
}),
);
const app = await NestFactory.create(
AppModule.forRoot({
providers: [...environment.storage.providers()],
}),
{logger:WinstonModule.createLogger({
levels: winston.config.syslog.levels,
level: 'info',
format: formatter,
transports: [
new winston.transports.Console({format:nestWinstonModuleUtilities.format.nestLike()}),
winstonAzureBlob({
account: {
connectionString: "DefaultEndpointsProtocol=https;AccountName=logstestss;AccountKey=<myaccountkey>;EndpointSuffix=core.windows.net",
},
blobName: "logs.log",
bufferLogSize: 1,
containerName: "logs",
level: 'info',
rotatePeriod: "YYYY-MM-DD",
syncTimeout: 0,
})
],
})
});
I tried using another library, import { winstonAzureBlob } from 'winston3-azureblob-transport';
.
It still gives the same error as before with the missing properties.