src/Serilog.Sinks.Elasticsearch/LoggerConfigurationElasticSearchExtensions.cs
/// <summary>
/// Adds a sink that writes log events as documents to an Elasticsearch index.
/// This works great with the Kibana web interface when using the default settings.
/// 
/// By passing in the BufferBaseFilename, you make this into a durable sink. 
/// Meaning it will log to disk first and tries to deliver to the Elasticsearch server in the background.
/// </summary>
/// <remarks>
/// Make sure to have a sensible mapping in your Elasticsearch indexes. 
/// You can automatically create one by specifying this in the options.
/// </remarks>
/// <param name="loggerSinkConfiguration">Options for the sink.</param>
/// <param name="options">Provides options specific to the Elasticsearch sink</param>
/// <returns>LoggerConfiguration object</returns>
Adds a sink that writes log events as documents to an Elasticsearch index.
This works great with the Kibana web interface when using the default settings.

By passing in the BufferBaseFilename, you make this into a durable sink.
Meaning it will log to disk first and tries to deliver to the Elasticsearch server in the background.
Adds a sink that writes log events as documents to an Elasticsearch index . This works great with the Kibana web interface when using the default settings . By passing in the BufferBaseFilename you make this into a durable sink . Meaning it will log to disk first and tries to deliver to the Elasticsearch server in the background .
public static LoggerConfiguration Elasticsearch(
            this LoggerSinkConfiguration loggerSinkConfiguration,
            ElasticsearchSinkOptions options = null)
        {
            options = options ?? new ElasticsearchSinkOptions(new[] { new Uri(DefaultNodeUri) });
            var sink = string.IsNullOrWhiteSpace(options.BufferBaseFilename)
                ? (ILogEventSink)new ElasticsearchSink(options)
                : new DurableElasticsearchSink(options);
            return loggerSinkConfiguration.Sink(
                sink,
                restrictedToMinimumLevel: options.MinimumLogEventLevel ?? LevelAlias.Minimum,
                levelSwitch: options.LevelSwitch
            );
        }
public static LoggerConfiguration Elasticsearch ( this LoggerSinkConfiguration loggerSinkConfiguration , ElasticsearchSinkOptions options = null ) { options = options ?? new ElasticsearchSinkOptions ( new [ ] { new Uri ( DefaultNodeUri ) } ) ; var sink = string . IsNullOrWhiteSpace ( options . BufferBaseFilename ) ? ( ILogEventSink ) new ElasticsearchSink ( options ) : new DurableElasticsearchSink ( options ) ; return loggerSinkConfiguration . Sink ( sink , restrictedToMinimumLevel : options . MinimumLogEventLevel ?? LevelAlias . Minimum , levelSwitch : options . LevelSwitch ) ; }
Adds a sink that writes log events as documents to an Elasticsearch index.
Adds a sink that writes log events as documents to an Elasticsearch index .
None
LoggerSinkConfiguration
this
options
ElasticsearchSinkOptions
Provides options specific to the Elasticsearch sink
Provides options specific to the Elasticsearch sink
loggerSinkConfiguration
Options for the sink.
Options for the sink .
remarks
Make sure to have a sensible mapping in your Elasticsearch indexes.
You can automatically create one by specifying this in the options.
Make sure to have a sensible mapping in your Elasticsearch indexes . You can automatically create one by specifying this in the options .