项目作者: bruno-garcia

项目描述 :
log4net appender to ElasticSearch
高级语言: C#
项目地址: git://github.com/bruno-garcia/log4net.ElasticSearch.git
创建时间: 2013-01-15T02:41:49Z
项目社区:https://github.com/bruno-garcia/log4net.ElasticSearch

开源协议:Other

下载


log4net.ElasticSearch

NuGet
AppVeyor

log4net.ElasticSearch is a module for the log4net library to log messages to the ElasticSearch document database. ElasticSearch offers robust full-text searching an analyzation so that errors and messages can be indexed quickly and searched easily.

Features:

  • Supports .NET 4.0+, .NET Standard 2.0+
  • Easy installation and setup via Nuget
  • Full support for the Elasticsearch _bulk API for buffered logging

Usage:

Please see the DOCUMENTATION Wiki page to begin logging errors to ElasticSearch!

Example log4net Document in Elasticsearch

  1. {
  2. "_index": "log-2016.02.12",
  3. "_type": "logEvent",
  4. "_id": "AVLXHEwEJfnUYPcgkJ5r",
  5. "_version": 1,
  6. "_score": 1,
  7. "_source": {
  8. "timeStamp": "2016-02-12T20:11:41.5864254Z",
  9. "message": "Something broke.",
  10. "messageObject": {},
  11. "exception": {
  12. "Type": "System.Exception",
  13. "Message": "There was a system error",
  14. "HelpLink": null,
  15. "Source": null,
  16. "HResult": -2146233088,
  17. "StackTrace": null,
  18. "Data": {
  19. "CustomProperty": "CustomPropertyValue",
  20. "SystemUserID": "User43"
  21. },
  22. "InnerException": null
  23. },
  24. "loggerName": "log4net.ES.Example.Program",
  25. "domain": "log4net.ES.Example.vshost.exe",
  26. "identity": "",
  27. "level": "ERROR",
  28. "className": "log4net.ES.Example.Program",
  29. "fileName": "C:\\Users\\jtoto\\projects\\log4net.ES.Example\\log4net.ES.Example\\Program.cs",
  30. "lineNumber": "26",
  31. "fullInfo": "log4net.ES.Example.Program.Main(C:\\Users\\jtoto\\projects\\log4net.ES.Example\\log4net.ES.Example\\Program.cs:26)",
  32. "methodName": "Main",
  33. "fix": "LocationInfo, UserName, Identity, Partial",
  34. "properties": {
  35. "log4net:Identity": "",
  36. "log4net:UserName": "JToto",
  37. "log4net:HostName": "JToto01",
  38. "@timestamp": "2016-02-12T20:11:41.5864254Z"
  39. },
  40. "userName": "JToto",
  41. "threadName": "9",
  42. "hostName": "JTOTO01"
  43. }
  44. }

Issues:

I do my best to reply to issues or questions ASAP. Please use the ISSUES page to submit questions or errors.

License:

MIT License

Thanks:

How to build

Use the psake.cmd file in the base directory for all build tasks.

.\psake.cmd

This will run the default task which compiles and runs the tests.

.\psake.cmd package

This task compiles the solution, runs the tests then creates a nuget package