Skip to content

NLog Target for Azure Storage. Uses NLog batch write to optimize writes to Storage.

License

Notifications You must be signed in to change notification settings

lucianaparaschivei/NLog.Extensions.AzureStorage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLog Targets for Azure Storage AppVeyor

logo

Package Name NuGet Description Documentation
NLog.Extensions.AzureBlobStorage NuGet Azure Blob Storage Docs
NLog.Extensions.AzureCosmosTable NuGet Azure Table Storage or Azure CosmosDb Tables Docs
NLog.Extensions.AzureEventHub NuGet Azure EventHubs Docs
NLog.Extensions.AzureQueueStorage NuGet Azure Queue Storage Docs
NLog.Extensions.AzureAccessToken NuGet Azure App Authentication Access Token Docs

Before all NLog targets was bundled into a single nuget-package called NLog.Extensions.AzureStorage. But Microsoft decided to discontinue WindowsAzure.Storage and split into multiple parts.

Sample Configuration

<extensions>
  <add assembly="NLog.Extensions.AzureBlobStorage" /> 
  <add assembly="NLog.Extensions.AzureCosmosTable" /> 
  <add assembly="NLog.Extensions.AzureEventHub" /> 
  <add assembly="NLog.Extensions.AzureQueueStorage" /> 
  <add assembly="NLog.Extensions.AzureAccessToken" /> 
</extensions>

<targets async="true">
    <target type="AzureBlobStorage"
            name="AzureEmulator"
            layout="${longdate:universalTime=true} ${level:uppercase=true} - ${logger}: ${message} ${exception:format=tostring:innerFormat=tostring:maxInnerExceptionLevel=1000}"
            connectionString="UseDevelopmentStorage=true;"
            container="${level}"
            blobName="${date:universalTime=true:format=yyyy-MM-dd}/${date:universalTime=true:format=HH}.log" />
    <target type="AzureBlobStorage"
            name="Azure"
            layout="${longdate:universalTime=true} ${level:uppercase=true} - ${logger}: ${message} ${exception:format=tostring:innerFormat=tostring:maxInnerExceptionLevel=1000}"
            connectionStringKey="storageConnectionString"
            container="${machinename}"
            blobName="${logger}/${date:universalTime=true:format=yy-MM-dd}/${date:universalTime=true:format=mm}.log" />
    <target type="AzureCosmosTable"
            name="AzureTable"
            connectionStringKey="storageConnectionString"
            layout="${longdate:universalTime=true} ${level:uppercase=true} - ${logger}: ${message} ${exception:format=tostring:innerFormat=tostring:maxInnerExceptionLevel=1000}"
            tableName="NlogTable" />
    <target type="AzureQueueStorage"
            name="AzureQueue"
            connectionStringKey="storageConnectionString"
            layout="${longdate:universalTime=true} ${level:uppercase=true} - ${logger}: ${message} ${exception:format=tostring:innerFormat=tostring:maxInnerExceptionLevel=1000}"
            queueName="NlogQueue" />
    <target type="AzureEventHub"
            name="AzureEventHub"
            connectionString="Endpoint=sb://test.servicebus.windows.net/;SharedAccessKeyName=NLog;SharedAccessKey=EventHub"
            layout="${longdate:universalTime=true} ${level:uppercase=true} - ${logger}: ${message} ${exception:format=tostring:innerFormat=tostring:maxInnerExceptionLevel=1000}"
            eventHubName="NlogHub"
            PartitionKey="0"/>
</targets>

License

FOSSA Status

About

NLog Target for Azure Storage. Uses NLog batch write to optimize writes to Storage.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%