Giter Club home page Giter Club logo

log4net.appender.loki's Introduction

log4net Loki Appender

This appender will allow log4net to be configured to send log messages to Loki directly.

Dot Net Framework 4 (Build)

Installation

The log4net.Appender.LokiAppender NuGet package can be found here. Alternatively you can install it via one of the following commands below:

NuGet command:

Install-Package log4net.Appender.Loki

Log4net configuration

Sample Log4net config:

<log4net>
  <appender name="loki" type="log4net.Appender.LokiAppender, log4net.Appender.Loki">
    <BufferSize  value="3" /> <!-- To configure the buffer size, default: 512 -->
    <ServiceUrl value="http://localhost:3100" /> <!-- Loki URL -->
    <BasicAuthUserName value="username" /> <!-- To be added if basic authent enabled  -->
    <BasicAuthPassword value="password" /> <!-- To be added if basic authent enabled  -->
    <TrustSelfCignedCerts value="false" /> <!-- To trust self signed certificates. Default: false -->
  </appender>
</log4net>

log4net.appender.loki's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

log4net.appender.loki's Issues

log4net:ERROR Appender named [loki] not found.

<log4net>
  <root>
    <level value="ALL" />
    <appender-ref ref="console" />
    <appender-ref ref="file" />
    <appender-ref ref="loki" />
  </root>
  <appender name="console" type="log4net.Appender.ConsoleAppender">
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date %level %logger - %message%newline" />
    </layout>
  </appender>
  <appender name="loki" type="log4net.Appender.LokiAppender, log4net.Appender.Loki">
    <BufferSize  value="3" />
    <ServiceUrl value="http://localhost:3100/loki/api/v1/push" />
    <BasicAuthUserName value="username" />
    <BasicAuthPassword value="password" />
    <TrustSelfCignedCerts value="false" />
  </appender>
  <appender name="file" type="log4net.Appender.RollingFileAppender">
    <file value="myapp.log" />
    <appendToFile value="true" />
    <rollingStyle value="Size" />
    <maxSizeRollBackups value="5" />
    <maximumFileSize value="10MB" />
    <staticLogFileName value="true" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %level %logger - %message%newline" />
    </layout>
  </appender>
</log4net>

I have the above configurations and I am getting the following error.
log4net:ERROR Appender named [loki] not found.

I am using asp.net mvc (4.7.2).

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.