public BpSplunkSink(BpSplunkInfo splunkInfo, ConcurrentBag <LogEvent> logs = null, Timer timer = null, HttpClient httpClient = null) : base(httpClient ?? new HttpClient(), timer, logs) { _basicAuth = CreateBasicAuth(splunkInfo); _splunkInfo = splunkInfo; }
private AuthenticationHeaderValue CreateBasicAuth(BpSplunkInfo splunkInfo) { string usernamePassword = $"{splunkInfo.Username}:{splunkInfo.Password}"; byte[] encodedBytes = Encoding.UTF8.GetBytes(usernamePassword); return(new AuthenticationHeaderValue("Basic", Convert.ToBase64String(encodedBytes))); }
public static LoggerConfiguration BpSplunkSink( this LoggerSinkConfiguration loggerConfiguration, BpSplunkInfo splunkInfo, ConcurrentBag <LogEvent> logs = null, Timer timer = null, HttpClient httpClient = null, LogEventLevel restrictedToMinimumLevel = LogEventLevel.Information) { return(loggerConfiguration.Sink(new BpSplunkSink(splunkInfo, logs, timer, httpClient), restrictedToMinimumLevel)); }