GithubHelp home page GithubHelp logo

Comments (4)

jptoto avatar jptoto commented on June 2, 2024

@xiaotupansy I agree the message should also be included in the _source.message field even if the message is rendered as an Exception() object. I'll work on this.

from log4net.elasticsearch.

jptoto avatar jptoto commented on June 2, 2024

@xiaotupansy I've tried this on both a console project and asp.net MVC and can't seem to duplicate the results. The RenderedMessage should be appearing in the _source.message field for you. Can you tell me which version of log4net, MVC, and Elasticsearch your're using?

from log4net.elasticsearch.

xiaotupansy avatar xiaotupansy commented on June 2, 2024

@jptoto Here's the config for mvc project:

<package id="log4net" version="2.0.5" targetFramework="net45" />
  <package id="log4net.ElasticSearch" version="2.3.3" targetFramework="net45" />
  <package id="Microsoft.AspNet.Mvc" version="5.2.2" targetFramework="net45" />

And the version of Elasticsearch is 2.3.2.

from log4net.elasticsearch.

xiaotupansy avatar xiaotupansy commented on June 2, 2024

And here's the configuration:

<log4net>
    <appender name="ElasticSearchAppender" type="log4net.ElasticSearch.ElasticSearchAppender, log4net.ElasticSearch">
      <connectionString value="Server=localhost;Index=testlog;Port=9200;"/>
      <Fix value="0"/>
      <bufferSize value="3" />
    </appender>
    <appender name="textLogger" type="log4net.Appender.RollingFileAppender">
      <file value="C:/temp/testlog.log" />
      <rollingStyle value="Date" />
      <datePattern value=".yyyyMMdd" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger property:[%property{NDC}] -%message %location%newline" />
      </layout>
    </appender>
    <logger name="ESLogger">
      <level value="INFO" />
      <appender-ref ref="textLogger" />
      <appender-ref ref="ElasticSearchAppender" />
    </logger>
  </log4net>

from log4net.elasticsearch.

Related Issues (20)

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.