private void ParseLogCastOptions(StringDictionary attributes) { Options = LogCastOptions.Parse( attributes["endpoint"], attributes["throttling"], attributes["retryTimeout"], attributes["sendingThreadCount"], attributes["sendTimeout"], attributes["enableSelfDiagnostics"]); }
private void Initialize() { FallbackLogger = CreateFallbackLogger(); Options = LogCastOptions.Parse( Endpoint, Throttling, RetryTimeout, SendingThreadCount, SendTimeout, EnableSelfDiagnostics); _messageRouter = new LogMessageRouter(ParseSkipPercentage(SkipPercentage)); // This case is mostly for scenario when a client uses "real" NLog LogManager // and doesn't use our ILogger/LogManager/LogConfig if (!LogConfig.IsConfigured && !LogConfig.IsInProgress) { LogConfig.Configure(new NLogManager(this)); } }
public DirectLogManager() { var configuration = ConfigurationSection.Read(); var logLevel = (LogLevel)Enum.Parse(typeof(LogLevel), configuration.LogLevel); var loggerOptions = new DirectLoggerOptions(logLevel, configuration.Type) { Layout = configuration.Layout, FallbackLogDirectory = configuration.FallbackLogDirectory, DaysToKeepFallbackLogs = configuration.DaysToKeepFallbackLogs }; var logCastOptions = LogCastOptions.Parse(configuration.Endpoint, configuration.Throttling, null, configuration.SendingThreadCount, null, configuration.EnableSelfDiagnostics); Init(loggerOptions, logCastOptions); }
public void then_throttling_10_does_not_throws() { new LogCastClient(LogCastOptions.Parse("http://host", "10", null, "10", null, null), Mock.Of <IFallbackLogger>()); }
public void then_throttling_less_than_10_throws() { Assert.Throws <ArgumentException>(() => new LogCastClient(LogCastOptions.Parse("http://host", "9", null, "10", null, null), Mock.Of <IFallbackLogger>())); }