1- # Serilog.Sinks.Elasticsearch
1+ # Serilog.Sinks.Elasticsearch [ ![ Build status ] ( https://ci.appveyor.com/api/projects/status/bk367tcnx9qt2sjy/branch/master?svg=true )] ( https://ci.appveyor.com/project/serilog/serilog-sinks-elasticsearch/branch/master ) [ ![ NuGet Badge ] ( https://img.shields.io/nuget/v/Serilog.Sinks.Elasticsearch.svg )] ( https://www.nuget.org/packages/Serilog.Sinks.Elasticsearch )
22
3- [ ![ Build status ] ( https://ci.appveyor.com/api/projects/status/bk367tcnx9qt2sjy/branch/master?svg=true )] ( https://ci.appveyor.com/project/serilog/serilog-sinks-elasticsearch/branch/master )
3+ This repository contains two nuget packages: ` Serilog.Sinks.Elasticsearch ` and ` Serilog.Formatting.Elasticsearch ` .
44
55## Table of contents
66
77* [ What is this sink] ( #what-is-this-sink )
88* [ Features] ( #features )
99* [ Quick start] ( #quick-start )
10+ * [ Elasticsearch sinks] ( #elasticsearch-sinks )
11+ * [ Elasticsearch formatters] ( #elasticsearch-formatters )
1012* [ More information] ( #more-information )
1113 * [ A note about fields inside Elasticsearch] ( #a-note-about-fields-inside-elasticsearch )
1214 * [ A note about Kibana] ( #a-note-about-kibana )
@@ -30,6 +32,8 @@ The Serilog Elasticsearch sink project is a sink (basically a writer) for the Se
3032
3133## Quick start
3234
35+ ### Elasticsearch sinks
36+
3337``` powershell
3438Install-Package serilog.sinks.elasticsearch
3539```
@@ -88,6 +92,24 @@ With the appSettings configuration the `nodeUris` property is required. Multiple
8892
8993And start writing your events using Serilog.
9094
95+ ### Elasticsearch formatters
96+
97+ ``` powershell
98+ Install-Package serilog.formatting.elasticsearch
99+ ```
100+
101+ The ` Serilog.Formatting.Elasticsearch ` nuget package consists of a several formatters:
102+
103+ * ` ElasticsearchJsonFormatter ` - custom json formatter that respects the configured property name handling and forces ` Timestamp ` to @timestamp .
104+ * ` ExceptionAsObjectJsonFormatter ` - a json formatter which serializes any exception into an exception object.
105+
106+ Override default formatter if it's possible with selected sink
107+
108+ ``` csharp
109+ var loggerConfig = new LoggerConfiguration ()
110+ .WriteTo .Console (new ElasticsearchJsonFormatter ());
111+ ```
112+
91113## More information
92114
93115* [ Basic information] ( https://github.com/serilog/serilog-sinks-elasticsearch/wiki/basic-setup ) on how to configure and use this sink.
0 commit comments