Parsimotion / winston-azure-blob-transport

A Winston Transport - Azure Blob Storage
MIT License
3 stars 8 forks source link

Required argument blob for function getBlobProperties is not defined #10

Closed chrisparton1991 closed 5 years ago

chrisparton1991 commented 5 years ago

I just upgraded from 0.2.4 to the new 0.2.9 and I'm getting this error: Required argument blob for function getBlobProperties is not defined

I've narrowed down the issue to being introduced in 0.2.5 in commit 04de52de37b9651a9e10bff602e974660db0fdaa.

Here is my logger constructor, can you see any issues? I'm running NPM 6.4.1 and Node 8.4.0.

return new winston.Logger({
      transports: [
        new winston.transports.AzureBlob({
          account: {
            name: 'test',
            key: '<Key>'
          },
          containerName: 'logs',
          blobName: 'Test Blob',
          level: 'info'
        })
      ]
});

Debugging into blobTransport.js, my containerName and blobName are set, the resolver is just returning undefined.

Workaround I was able to solve the issue by passing in nameResolver: { getBlobName: () => 'Test Blob' } instead of blobName: 'Test Blob'. Is this the correct way to use the API, and if so, should the examples be updated?

juanmjacobs commented 5 years ago

Hi! We've published a new version (0.2.10) that fixes this issue.

chrisparton1991 commented 5 years ago

Perfect, thanks for the quick fix! Appreciate it :)