Giter Club home page Giter Club logo

log4net---elmah-appender's Introduction

log4net---ELMAH-Appender

This appender will allow log4net to be configured to send log messages to ELMAH directly. This way ELMAH can be the log manager of record for sites while still allowing specific logging parameters to be controlled with log4net as usual.

Sample Log4net config:


<log4net>
    <appender name="elmahappender" type="elmahappender_log4net.ELMAHAppender, elmahappender_log4net">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [thread] %-5level %logger - %message%newline" />
      </layout>
      <UseNullContext>False</UseNullContext>
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="elmahappender" />
    </root>
  </log4net>
  

My elmah config:


  <elmah>
    <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="connString" applicationName="TTDev" />
  </elmah>
  

For the sql error log, I had to put the application name on the config. For v1 I could not figure out how to pass the application name through the log4net log, it would ignore what I passed as the app name and just insert an empty string. The application not matching caused the display handler to not display those log entries. Setting the application name in the configuration entry above solved that problem.

This problem did not present itself with the in memory log.

New for 1.0.2: A new setting was also added called UseNullContext. This is used when you want to initialize the logger outside of a HTTP request (such as application start).
Please see this issue for more details.

Note: A second nuget package was created with the dependancy for log4net dropped to 1.2.10 and .Net 2.0. There were complications getting both 1.2.10 and 1.2.11 dependencies to work in the same package. That second package can be found Here

log4net---elmah-appender's People

Contributors

edwinf avatar

Watchers

Charlie 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.