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
configurationLoggerSinkConfigurationThe logger config
splunkHoststringThe Splunk host that is configured with an Event Collector
eventCollectorTokenstringThe token provided to authenticate to the Splunk Event Collector
jsonFormatterITextFormatterThe text formatter used to render log events into a JSON format for consumption by Splunk
uriPathstringChange the default endpoint of the Event Collector e.g. services/collector/event
restrictedToMinimumLevelLogEventLevelThe minimum log event level required in order to write an event to the sink.
batchIntervalInSecondsintThe interval in seconds that the queue should be instpected for batching
batchSizeLimitintThe size of the batch
queueLimitint?Maximum number of events in the queue
messageHandlerHttpMessageHandlerThe handler used to send HTTP requests
levelSwitchLoggingLevelSwitchA 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
configurationLoggerSinkConfigurationThe logger config
splunkHoststringThe Splunk host that is configured with an Event Collector
eventCollectorTokenstringThe token provided to authenticate to the Splunk Event Collector
fieldsCustomFieldsCustomfields that will be indexed in splunk with this event
uriPathstringChange the default endpoint of the Event Collector e.g. services/collector/event
sourcestringThe source of the event
sourceTypestringThe source type of the event
hoststringThe host of the event
indexstringThe Splunk index to log to
restrictedToMinimumLevelLogEventLevelThe minimum log event level required in order to write an event to the sink.
formatProviderIFormatProviderSupplies culture-specific formatting information, or null.
renderTemplateboolIf ture, the message template will be rendered
renderMessageboolInclude "RenderedMessage" parameter in output JSON message.
batchIntervalInSecondsintThe interval in seconds that the queue should be instpected for batching
batchSizeLimitintThe size of the batch
queueLimitint?Maximum number of events in the queue
messageHandlerHttpMessageHandlerThe handler used to send HTTP requests
levelSwitchLoggingLevelSwitchA switch allowing the pass-through minimum level to be changed at runtime.
subSecondPrecisionSubSecondPrecisionTimestamp 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
configurationLoggerSinkConfigurationThe logger config
splunkHoststringThe Splunk host that is configured with an Event Collector
eventCollectorTokenstringThe token provided to authenticate to the Splunk Event Collector
uriPathstringChange the default endpoint of the Event Collector e.g. services/collector/event
sourcestringThe source of the event
sourceTypestringThe source type of the event
hoststringThe host of the event
indexstringThe Splunk index to log to
restrictedToMinimumLevelLogEventLevelThe minimum log event level required in order to write an event to the sink.
formatProviderIFormatProviderSupplies culture-specific formatting information, or null.
renderTemplateboolIf true, the message template will be rendered
renderMessageboolInclude "RenderedMessage" parameter in output JSON message.
batchIntervalInSecondsintThe interval in seconds that the queue should be instpected for batching
batchSizeLimitintThe size of the batch
queueLimitint?Maximum number of events in the queue
messageHandlerHttpMessageHandlerThe handler used to send HTTP requests
levelSwitchLoggingLevelSwitchA switch allowing the pass-through minimum level to be changed at runtime.
subSecondPrecisionSubSecondPrecisionTimestamp sub-second precision. Splunk props.conf setup is required.
Returns
- LoggerConfiguration