Git Product home page Git Product logo

elmah.io.elasticsearch's People

Contributors

bensmind avatar guibranco avatar jayhilden avatar mpdreamz avatar refactorthis avatar smurfpandey avatar thomasardal avatar trymbeast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elmah.io.elasticsearch's Issues

Environment name not used to filter errors in elmah

Hello,

I just wanted to know why the environment name is not being used to filter the errors to show on the elmah page? This is really annoying if you use the same index in the same elasticsearch cluster for different environments, but with the same application name.

upgrade packages

  • .NET Framework -> 4.0 to 4.6.1
  • ElasticSearch.Net -> 1.4.2 to 1.7.1
  • Newtonsoft.Json -> 6.0.8 to 7.0.1 (updating to 8.x caused errors)
  • NEST -> 1.4.1 to 1.7.1

Update the nuget configuration to specify new minimum requirement for these.

Convert the following fields to to multi-field: message, type, source

Currently the fields "message", "type", and "source" are string fields which the ES indexer will split. This is great when searching for individual words (i.e. how many errors happened with the phrase "was not found"), but this will not allow you to do an aggregation on all alerts with the message ""The controller for path '/foo' was not found or does not implement IController."

In order to do aggregations on the fields they must be a multi-fields in ES.

Upgrade to NEST 2.0

Hi there,

Just wondering when you think you might upgrade to the NEST 2.0 binaries?

Thanks!
Annie

CI Build improvements

  1. Ensure support for .NET 4.6.1
  2. Support C# 6 syntax
  3. Support CI build on branches that publish -prerelease candidates to Nuget

solution reorg

move things around a little in the source files and in the solution explorer.

  • all source code moved into src folder
  • testing project moved into testing folder
  • example projects moved into examples folder
  • can we remove the nuget folder and add an appveyor explicit command for it?

On install, add connection string for elmah

When someone installs the nuget package, add the follwoing connection string:

<add name="ElmahElasticSearch" connectionString="Nodes=http://localhost:9200;DefaultIndex=elmah;" />

Also update the configuration section with the correct connection string name including:

  1. application name
  2. environment name
  3. customer name
  <elmah>
    <errorLog
        type="Elmah.Io.ElasticSearch.ElasticSearchErrorLog, Elmah.Io.ElasticSearch, Version=1.0.0.0, Culture=neutral"
        connectionStringName="ElmahElasticSearch"
        applicationName="ElmahElasticSearchSampleWebsite"
        environmentName="development"
        customerName="sample customer"
        />
  </elmah>

.Net 4.6 in 3.0.0.69

The latest NuGet version (3.0.0.69) includes a folder for .Net 4.6 but the assembly is targeting 4.7.2.
I have projects that target the 4.6.1 and what happens is that the package is installed but then it won't compile.

Replica settings should not be set to zero

Currently, when the Elmah index is setup in ElasticSearch the following defaults are overridden:

Replicas = 0
Shards = 1
merge.policy.merge_factor = 10 --note: this is the Elastic Default
search.slowlog.threshold.fetch.warn = 1s

In a production environment where there is more than 1 node setting replicas = 0 means that a copy of the data would not exist on the other nodes in the cluster. This is not ideal.

ElasticSearch support recommends leaving all of these at the default values and only tweaking them if necessary in production.

startIndex cannot be larger than length of string

Hi,
I've ran into a problem with basic setup,

<connectionStrings>
    <add name="ElmahElasticSearch" connectionString="http://foo.bar:9200" />
  </connectionStrings>

<elmah>
    <!--
        See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for 
        more information on remote access and securing ELMAH.
    -->
    <security allowRemoteAccess="false" />
    <errorLog type="Elmah.Io.ElasticSearch.ElasticSearchErrorLog, Elmah.Io.ElasticSearch" connectionStringName="ElmahElasticSearch" defaultIndex="elmah" />
  </elmah>

And I'm getting following exception.

System.ArgumentOutOfRangeException was unhandled by user code
HResult=-2146233086
Message=startIndex cannot be larger than length of string.
Parameter name: startIndex
Source=mscorlib
ParamName=startIndex
StackTrace:
at System.String.Substring(Int32 startIndex, Int32 length)
at System.String.Substring(Int32 startIndex)
at Elmah.Io.ElasticSearch.ElasticSearchErrorLog.GetDefaultIndexFromConnectionString(String connectionString) in z:\Builds\work\999c9445caaa3f48\Elmah.Io.ElasticSearch\ElasticSearchErrorLog.cs:line 159
at Elmah.Io.ElasticSearch.ElasticSearchErrorLog.GetDefaultIndex(IDictionary config, String connectionString) in z:\Builds\work\999c9445caaa3f48\Elmah.Io.ElasticSearch\ElasticSearchErrorLog.cs:line 146
at Elmah.Io.ElasticSearch.ElasticSearchErrorLog.InitElasticSearch(IDictionary config) in z:\Builds\work\999c9445caaa3f48\Elmah.Io.ElasticSearch\ElasticSearchErrorLog.cs:line 113
at Elmah.Io.ElasticSearch.ElasticSearchErrorLog..ctor(IDictionary config) in z:\Builds\work\999c9445caaa3f48\Elmah.Io.ElasticSearch\ElasticSearchErrorLog.cs:line 24
InnerException:

remove C# 6.0 syntax

The build server is not yet configured to support C# 6, so for now we're going to remove those instances

AppVeyor integration

It's free for open source project. It will automagically detect all the tests of the project. You can also add a badge with build status.

support ElasticSearch Shield

suggested priv setup:

# Elmah
elmah:
  indices:
    'elmah':
      privileges: read, index, indices:admin/get, indices:admin/exists, indices:admin/mapping/put, create_index

Multifield mapping doesn't create raw field when index is newly created

In ElasticClientSingleton.cs PropertiesDescriptor method, multi field suffix doesn't create raw field when index is newly created.

Here is the elmah index mapping:

{
   "elmah": {
      "mappings": {
         "error": {
            "properties": {
               "@timestamp": {
                  "type": "date",
                  "format": "dateOptionalTime"
               },
               "applicationName": {
                  "type": "string"
               },
               "detail": {
                  "type": "string"
               },
               "environmentName": {
                  "type": "string"
               },
               "errorXml": {
                  "type": "string"
               },
               "hostName": {
                  "type": "string"
               },
               "message": {
                  "type": "string"
               },
               "source": {
                  "type": "string"
               },
               "statusCode": {
                  "type": "long"
               },
               "type": {
                  "type": "string"
               }
            }
         }
      }
   }
}

Revert to .Net 4.6.1

Would you be opposed to reverting .Net versions from 4.7.2 to 4.6.1? It looks like it was updated across the board in this commit, and the nuspec was fixed here to go along with it.

The updates don't seem to actually require 4.7.2 however (only based on a local build succeeding, I could be wrong), so I'm wondering if reverting could be done to expand compatibility with those of us who aren't on the latest and greatest :)

Using in WEB API

I already using Elmah to send email with errors.

I tested the sample and works fine.

When i configured to ElasticSearch in my webapi project the output:

GET elmah/error/_search { "query": { "match_all": {} } }

this result

{ "took": 1, "timed_out": false, "_shards": { "total": 5, "successful": 5, "skipped": 0, "failed": 0 }, "hits": { "total": 4, "max_score": 1, "hits": [ { "_index": "elmah", "_type": "error", "_id": "3dox_WQBVZNQ__bDh_oa", "_score": 1, "_source": { "query": { "match_all": {} } } }, { "_index": "elmah", "_type": "error", "_id": "_search_shards", "_score": 1, "_source": { "query": { "match_all": {} } } }, { "_index": "elmah", "_type": "error", "_id": "3Nox_WQBVZNQ__bDafq5", "_score": 1, "_source": { "query": { "match_all": {} } } }, { "_index": "elmah", "_type": "error", "_id": "_percolate", "_score": 1, "_source": { "query": { "match_all": {} } } } ] } }

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.