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

narenkv/NLog.Extensions.AzureStorage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLog.Extensions.AzureStorage AppVeyor NuGet

logo

NLog Target for Azure Blob and Table Storage.

Blob Configuration

Syntax

<targets>
  <target xsi:type="AzureBlobStorage"
          name="String"
          layout="Layout"
          blobName="Layout"
          connectionString="String"
          connectionStringKey="String"
          container="Layout" />
</targets>

Parameters

name - Name of the target.

layout - Text to be rendered. Layout Required.

blobName - BlobName. Layout

connectionString - Azure storage connection string. Must provide either connectionString or connectionStringKey.

connectionStringKey - App key name of Azure storage connection string. Must provide either connectionString or connectionStringKey.

container - Azure blob container name. Layout

Table Configuration

Syntax

<targets>
  <target xsi:type="AzureTableStorage"
          name="String"
          layout="Layout"
          connectionString="String"
          connectionStringKey="String"
          tableName="Layout" />
</targets>

Parameters

name - Name of the target.

layout - Text to be rendered. Layout Required.

connectionString - Azure storage connection string. Must provide either connectionString or connectionStringKey.

connectionStringKey - App key name of Azure storage connection string. Must provide either connectionString or connectionStringKey.

tableName - Azure table name. Layout

Sample Configuration

<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="AzureTableStorage"
            name="AzureTable"
            connectionStringKey="storageConnectionString"
            layout="${longdate:universalTime=true} ${level:uppercase=true} - ${logger}: ${message} ${exception:format=tostring:innerFormat=tostring:maxInnerExceptionLevel=1000}"
            tableName="NlogTable" />
</targets>

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%