mahdighorbanpour / serilog-sinks-azurecosmosdb

A Serilog sink that writes to Azure CosmosDB and supports PartitionKey for better performance.
Apache License 2.0
4 stars 5 forks source link

Fixes logging inside bulk import and bubbles to SelfLog, version bump. #5

Closed tghamm closed 2 years ago

tghamm commented 2 years ago

@mahdighorbanpour this commit changes the console.warn inside bulkImport.js to console.log, and enables script logging when executing the stored procedure. If logs are returned, they are pumped to SelfLog so that a consumer can hook into them and better understand what the error was. I have also made very minor changes to the README, and incremented the version to 2.0.1. This commit is a fix to help the end user in #4 address the issue they are encountering with better diagnostics, as they are currently swallowed by the stored procedure.

A note, the stored procedure must be deleted on existing instances to take advantage of the new logging.

tghamm commented 2 years ago

@mahdighorbanpour based on more feedback, there's probably another commit coming to actually fix their issue, though this commit still adds value on it's own, but I'd wait to merge.

tghamm commented 2 years ago

@mahdighorbanpour this PR should be ready to merge. I made another change that will update the bulkImport.js function to match the package version automatically if it is detected to be out of date. This will make sure that any future updates to the procedure will actually be applied when the package is updated by end-users.