Class SplunkLoggingConfigurationExtensions
- Namespace
- Serilog
- Assembly
- Serilog.Sinks.Splunk.dll
Fluent configuration methods for Logger configuration
public static class SplunkLoggingConfigurationExtensions
- Inheritance
-
SplunkLoggingConfigurationExtensions
- Inherited Members
Methods
EventCollector(LoggerSinkConfiguration, string, string, ITextFormatter, string, LogEventLevel, int, int, int?, HttpMessageHandler, LoggingLevelSwitch)
Adds a sink that writes log events as to a Splunk instance via the HTTP Event Collector.
public static LoggerConfiguration EventCollector(this LoggerSinkConfiguration configuration, string splunkHost, string eventCollectorToken, ITextFormatter jsonFormatter, string uriPath = "services/collector/event", LogEventLevel restrictedToMinimumLevel = 0, int batchIntervalInSeconds = 2, int batchSizeLimit = 100, int? queueLimit = null, HttpMessageHandler messageHandler = null, LoggingLevelSwitch levelSwitch = null)
Parameters
configuration
LoggerSinkConfigurationThe logger config
splunkHost
stringThe Splunk host that is configured with an Event Collector
eventCollectorToken
stringThe token provided to authenticate to the Splunk Event Collector
jsonFormatter
ITextFormatterThe text formatter used to render log events into a JSON format for consumption by Splunk
uriPath
stringChange the default endpoint of the Event Collector e.g. services/collector/event
restrictedToMinimumLevel
LogEventLevelThe minimum log event level required in order to write an event to the sink.
batchIntervalInSeconds
intThe interval in seconds that the queue should be instpected for batching
batchSizeLimit
intThe size of the batch
queueLimit
int?Maximum number of events in the queue
messageHandler
HttpMessageHandlerThe handler used to send HTTP requests
levelSwitch
LoggingLevelSwitchA switch allowing the pass-through minimum level to be changed at runtime.
Returns
- LoggerConfiguration
EventCollector(LoggerSinkConfiguration, string, string, CustomFields, string, string, string, string, string, LogEventLevel, IFormatProvider, bool, bool, int, int, int?, HttpMessageHandler, LoggingLevelSwitch, SubSecondPrecision)
Adds a sink that writes log events as to a Splunk instance via the HTTP Event Collector.
public static LoggerConfiguration EventCollector(this LoggerSinkConfiguration configuration, string splunkHost, string eventCollectorToken, CustomFields fields, string uriPath = "services/collector/event", string source = "", string sourceType = "", string host = "", string index = "", LogEventLevel restrictedToMinimumLevel = 0, IFormatProvider formatProvider = null, bool renderTemplate = true, bool renderMessage = true, int batchIntervalInSeconds = 2, int batchSizeLimit = 100, int? queueLimit = null, HttpMessageHandler messageHandler = null, LoggingLevelSwitch levelSwitch = null, SubSecondPrecision subSecondPrecision = SubSecondPrecision.Milliseconds)
Parameters
configuration
LoggerSinkConfigurationThe logger config
splunkHost
stringThe Splunk host that is configured with an Event Collector
eventCollectorToken
stringThe token provided to authenticate to the Splunk Event Collector
fields
CustomFieldsCustomfields that will be indexed in splunk with this event
uriPath
stringChange the default endpoint of the Event Collector e.g. services/collector/event
source
stringThe source of the event
sourceType
stringThe source type of the event
host
stringThe host of the event
index
stringThe Splunk index to log to
restrictedToMinimumLevel
LogEventLevelThe minimum log event level required in order to write an event to the sink.
formatProvider
IFormatProviderSupplies culture-specific formatting information, or null.
renderTemplate
boolIf ture, the message template will be rendered
renderMessage
boolInclude "RenderedMessage" parameter in output JSON message.
batchIntervalInSeconds
intThe interval in seconds that the queue should be instpected for batching
batchSizeLimit
intThe size of the batch
queueLimit
int?Maximum number of events in the queue
messageHandler
HttpMessageHandlerThe handler used to send HTTP requests
levelSwitch
LoggingLevelSwitchA switch allowing the pass-through minimum level to be changed at runtime.
subSecondPrecision
SubSecondPrecisionTimestamp sub-second precision. Splunk props.conf setup is required.
Returns
- LoggerConfiguration
EventCollector(LoggerSinkConfiguration, string, string, string, string, string, string, string, LogEventLevel, IFormatProvider, bool, bool, int, int, int?, HttpMessageHandler, LoggingLevelSwitch, SubSecondPrecision)
Adds a sink that writes log events as to a Splunk instance via the HTTP Event Collector.
public static LoggerConfiguration EventCollector(this LoggerSinkConfiguration configuration, string splunkHost, string eventCollectorToken, string uriPath = "services/collector/event", string source = "", string sourceType = "", string host = "", string index = "", LogEventLevel restrictedToMinimumLevel = 0, IFormatProvider formatProvider = null, bool renderTemplate = true, bool renderMessage = true, int batchIntervalInSeconds = 2, int batchSizeLimit = 100, int? queueLimit = null, HttpMessageHandler messageHandler = null, LoggingLevelSwitch levelSwitch = null, SubSecondPrecision subSecondPrecision = SubSecondPrecision.Milliseconds)
Parameters
configuration
LoggerSinkConfigurationThe logger config
splunkHost
stringThe Splunk host that is configured with an Event Collector
eventCollectorToken
stringThe token provided to authenticate to the Splunk Event Collector
uriPath
stringChange the default endpoint of the Event Collector e.g. services/collector/event
source
stringThe source of the event
sourceType
stringThe source type of the event
host
stringThe host of the event
index
stringThe Splunk index to log to
restrictedToMinimumLevel
LogEventLevelThe minimum log event level required in order to write an event to the sink.
formatProvider
IFormatProviderSupplies culture-specific formatting information, or null.
renderTemplate
boolIf true, the message template will be rendered
renderMessage
boolInclude "RenderedMessage" parameter in output JSON message.
batchIntervalInSeconds
intThe interval in seconds that the queue should be instpected for batching
batchSizeLimit
intThe size of the batch
queueLimit
int?Maximum number of events in the queue
messageHandler
HttpMessageHandlerThe handler used to send HTTP requests
levelSwitch
LoggingLevelSwitchA switch allowing the pass-through minimum level to be changed at runtime.
subSecondPrecision
SubSecondPrecisionTimestamp sub-second precision. Splunk props.conf setup is required.
Returns
- LoggerConfiguration