Git Product home page Git Product logo

log4net.azure's Introduction

Stories in Ready #log4net.Azure

Transfer all your logs to the Azure Table or Blob Storage via Appender for log4Net

Install

Add To project via NuGet:

  1. Right click on a project and click 'Manage NuGet Packages'.
  2. Search for 'log4net.Appender.Azure' and click 'Install'.

Configuration

Table Storage

Every log entry is stored in a separate row.

<appender name="AzureTableAppender" type="log4net.Appender.AzureTableAppender, log4net.Appender.Azure">
   <param name="TableName" value="testLoggingTable"/>
   <!-- You can either specify a connection string or use the ConnectionStringName property instead -->
   <param name="ConnectionString" value="UseDevelopmentStorage=true"/>
   <!--<param name="ConnectionStringName" value="GlobalConfigurationString" />-->
   <!-- You can specify this to make each LogProperty as separate Column in TableStorage, 
	Default: all Custom Properties were logged into one single field -->
   <param name="PropAsColumn" value="true" />
   <param name="PartitionKeyType" value="LoggerName" />
 </appender>
  • TableName:
    Name of the table in Table Storage
  • ConnectionString:
    the full Azure Storage connection string
  • ConnectionStringName:
    Name of a connection string specified under connectionString
  • PropAsColumn(optional):
    Default: all properties were written in a single field(default).
    If you specifiy this with the value true then each custom log4net property is logged as separate column/field in the table.
    Remember that Table storage has a Limit of 255 Properties (see here).
  • PartitionKeyType(optional):
    Default "LoggerName": (each logger gets his own partition in Table Storage)
    "DateReverse": order by Date Reverse to see the latest items first (How to order elements by date reverse)

BlobStorage

Every log Entry is stored as separate XML file.

<appender name="AzureBlobAppender" type="log4net.Appender.AzureBlobAppender, log4net.Appender.Azure">
  <param name="ContainerName" value="testloggingblob"/>
  <param name="DirectoryName" value="logs"/>
  <!-- You can either specify a connection string or use the ConnectionStringName property instead -->
  <param name="ConnectionString" value="UseDevelopmentStorage=true"/>
  <!--<param name="ConnectionStringName" value="GlobalConfigurationString" />-->
</appender>
  • ContainerName:
    Name of the container in Blob Storage
  • DirectoryName:
    Name of the folder in the specified container
  • ConnectionString:
    the full Azure Storage connection string
  • ConnectionStringName:
    Name of a connection string specified under connectionString

AppendBlobStorage

Every log Entry is stored as separate XML file.

<appender name="AzureAppendBlobAppender" type="log4net.Appender.AzureAppendBlobAppender, log4net.Appender.Azure">
  <param name="ContainerName" value="testloggingblob"/>
  <param name="DirectoryName" value="logs"/>
  <!-- You can either specify a connection string or use the ConnectionStringName property instead -->
  <param name="ConnectionString" value="UseDevelopmentStorage=true"/>
  <!--<param name="ConnectionStringName" value="GlobalConfigurationString" />-->
</appender>
  • ContainerName:
    Name of the container in Blob Storage
  • DirectoryName:
    Name of the folder in the specified container
  • ConnectionString:
    the full Azure Storage connection string
  • ConnectionStringName:
    Name of a connection string specified under connectionString

View Logs

You can take a look on this Site to use one of this tools based on your selected appender.

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.