Skip to content

PrecisionCoding/Umbraco-AzureLogger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Umbraco Azure Logger

Azure Logger

Build status

This Umbraco package adds a log4net appender that uses Azure table storage and extends the Umbraco developer tree with functionality to view these logs, (using Azure table storage for logs in preference to the file-system has an additional benefit of reducing file replication activity in load balanced environments where the file system is being synchronised such as Azure Web Apps).

Once installed, edit the ConnectionString named "LoggingTableStorage" added to web.config include the name and key of your Azure storage account (ensure the account has the Table service enabled).

Tree Example

If your site is making a lot of log entries (e.g. you've set to DEBUG level) you should adjust the bufferSize value, this sets how often the logs are written to storage.

Example:

  <root>
    <priority value="Info"/>
    <appender-ref ref="AsynchronousLog4NetAppender" />
    <appender-ref ref="AllTableAppender"/>
    <appender-ref ref="WarningsTableAppender"/>
  </root>

  <appender name="AllTableAppender" type="Our.Umbraco.AzureLogger.Core.TableAppender, Our.Umbraco.AzureLogger.Core">
    <param name="ConnectionString" value="LoggingTableStorage"/>
    <param name="TableName" value="UALUmbracoTraceLog"/>
    <param name="TreeName" value="All Events"/>
    <bufferSize value="5"/>
    <!-- 0 indexed -->
  </appender>

  <appender name="WarningsTableAppender" type="Our.Umbraco.AzureLogger.Core.TableAppender, Our.Umbraco.AzureLogger.Core">
    <param name="ConnectionString" value="LoggingTableStorage"/>
    <param name="TableName" value="UALWarnings"/>
    <param name="TreeName" value="Warnings"/>
    <param name="IconName" value="icon-alert"/>
    <threshold value="WARN"/>
    <filter type="log4net.Filter.LevelRangeFilter">
      <levelMin value="WARN"/>
      <levelMax value="ERROR"/>
    </filter>
    <bufferSize value="0"/>
    <!-- 1 item in buffer -->
  </appender>

As a useful enhancement we also now store to URL and SessionId which triggered the log entry to be made, this can be very handy for tracking down issues.

Url Example

Installation

NuGet & Umbraco packages are available

NuGet Packages Version
Release NuGet download
Pre-release MyGet download
Umbraco Packages
Release Our Umbraco project page
Pre-release AppVeyor Artifacts

Licensing

This project is licensed under the Apache 2.0 license.

The project includes WindowsAzure.Storage licensed under the Apache License and Microsoft.Web.Xdt licensed under MS-EULA license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 62.5%
  • JavaScript 22.4%
  • HTML 8.4%
  • CSS 3.4%
  • Classic ASP 2.4%
  • Batchfile 0.9%