GithubHelp home page GithubHelp logo

wimagee / nlog.extensions.azuretablestorage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harouny/nlog.extensions.azuretablestorage

0.0 1.0 0.0 969 KB

Azure Table Storage Target for NLog

C# 100.00%

nlog.extensions.azuretablestorage's Introduction

NLog Azure Table Storage Target

Azure Table Storage Target for NLog

For more info about NLog targets and how to use it, refer to How To Write a Target

Download

Download package from Nuget

How to use

  • Download package from Nuget.
  • If you didn't setup Azure storage connection string yet, follow instructions in Setup a storage connection string.
  • Open NLog configurations file ex: NLog.config and add the following lines:
  • Add NLog.Extensions.AzureTableStorage assemply to extensions section:
  <extensions>
    <add assembly="NLog.Extensions.AzureTableStorage"/>
  </extensions>
  • Add AzureTableStorage target to targets section:
  <targets>
    <target xsi:type="AzureTableStorage" 
            name="[[target-name]]"
            ConnectionStringKey="[[connection-string-key]]" 
            TableName="[[table-name]]"
			PartitionKeyPrefix="[[partition-key-prefix-value]]"
			PartitionKeyPrefixKey="[[partition-key-prefix-configuration-key]]" />
  </targets>

Where [[target-name]] is a name you give for the target, [[connection-string-key]] is the key of Azure Storage Account connection string setting in App Settings or Cloud Service configuration file, and [[table-name]] is a name you give to the log table that will be created.

If multiple applications need to share the same storage account it is possible to prefix the partition keys used with a custom string. [[PartitionKeyPrefix]] and [[PartitionKeyPrefixKey]] are optional and [[PartitionKeyPrefixKey]] has precedence over a hard coded value in [[PartitionKeyPrefix]].

  • Add a rule that uses the target in rules section.
  <rules>
    <logger name="*" minlevel="Trace" writeTo="[[target-name]]" />
  </rules> 

Note: You can also configure this by code refer to How To Write a Target for more information.

How to View Logs?

A lot of ways you can access table storage.

Notes

  • Before running tests on you local machine, make sure Azure Storage Emulator is running.

nlog.extensions.azuretablestorage's People

Contributors

harouny avatar ericlau-solid avatar geekcubed avatar wendelstam avatar michaelsync avatar

Watchers

Iain Magee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.