Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Notes about formatters in readme #209

Merged
merged 2 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Serilog.Sinks.Elasticsearch
# 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)

[![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)
This repository contains two nuget packages: `Serilog.Sinks.Elasticsearch` and `Serilog.Formatting.Elasticsearch`.

## Table of contents

* [What is this sink](#what-is-this-sink)
* [Features](#features)
* [Quick start](#quick-start)
* [Elasticsearch sinks](#elasticsearch-sinks)
* [Elasticsearch formatters](#elasticsearch-formatters)
* [More information](#more-information)
* [A note about fields inside Elasticsearch](#a-note-about-fields-inside-elasticsearch)
* [A note about Kibana](#a-note-about-kibana)
Expand All @@ -30,6 +32,8 @@ The Serilog Elasticsearch sink project is a sink (basically a writer) for the Se

## Quick start

### Elasticsearch sinks

```powershell
Install-Package serilog.sinks.elasticsearch
```
Expand Down Expand Up @@ -88,6 +92,24 @@ With the appSettings configuration the `nodeUris` property is required. Multiple

And start writing your events using Serilog.

### Elasticsearch formatters

```powershell
Install-Package serilog.formatting.elasticsearch
```

The `Serilog.Formatting.Elasticsearch` nuget package consists of a several formatters:

* `ElasticsearchJsonFormatter` - custom json formatter that respects the configured property name handling and forces `Timestamp` to @timestamp.
* `ExceptionAsObjectJsonFormatter` - a json formatter which serializes any exception into an exception object.

Override default formatter if it's possible with selected sink

```csharp
var loggerConfig = new LoggerConfiguration()
.WriteTo.Console(new ElasticsearchJsonFormatter());
```

## More information

* [Basic information](https://github.com/serilog/serilog-sinks-elasticsearch/wiki/basic-setup) on how to configure and use this sink.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down