public async Task Start() { var settings = new CatchUpSubscriptionSettings( 2000 , 500 , _log.IsEnabled(LogEventLevel.Debug) , false); _log.Information("Starting the subscription manager..."); var position = await _checkpointStore.GetCheckpoint(); _log.Information("Retrieved the checkpoint: {checkpoint}", position); var _subscription = _connection.SubscribeToAllFrom(position , settings , EventAppeared , LiveProcessingStarted , SubscriptionDropped); // var _subscription = _connection.SubscribeToStreamFrom("$all" // ,position.Value.CommitPosition // , settings // , EventAppeared // , LiveProcessingStarted // , SubscriptionDropped); _log.Information("Subscribed to $all stream"); }
public void Serilog_WithIf() { if (_sLogger.IsEnabled(Serilog.Events.LogEventLevel.Information)) { _sLogger.Information(Message, 2022); } }
public bool WriteCore(TraceEventType eventType, int eventId, object state, Exception exception, Func <object, Exception, string> formatter) { var level = _getLogEventLevel(eventType); // According to docs http://katanaproject.codeplex.com/SourceControl/latest#src/Microsoft.Owin/Logging/ILogger.cs // "To check IsEnabled call WriteCore with only TraceEventType and check the return value, no event will be written." if (state == null) { return(_logger.IsEnabled(level)); } if (!_logger.IsEnabled(level)) { return(false); } _logger.Write(level, exception, formatter(state, exception)); return(true); }
public bool WriteCore(TraceEventType eventType, int eventId, object state, Exception exception, Func <object, Exception, string> formatter) { var level = _getLogEventLevel(eventType); if (state == null) { return(_logger.IsEnabled(level)); } if (!_logger.IsEnabled(level)) { return(false); } _logger.Write(level, exception, formatter(state, exception)); return(true); }
public SerilogLogger() { _log = new LoggerConfiguration() .MinimumLevel.Debug() .WriteTo.File("c:\\temp\\log.txt") .CreateLogger(); var isdebug = _log.IsEnabled(LogEventLevel.Debug); }
public void Start() { var settings = new CatchUpSubscriptionSettings( 2000, 500, Log.IsEnabled(LogEventLevel.Verbose), true, "try-out-subscription"); _subscription = _connection.SubscribeToAllFrom(Position.Start, settings, EventAppeared); }
public void Trace(string template, params object[] values) { if (_inner.IsEnabled(LogEventLevel.Verbose)) { _inner.Verbose(template, values); } }
public void LogWrite(string methodInfo, LogEventLevel level, string messageTemplate) { if (_logger.IsEnabled(level)) { DoLog(methodInfo, level, null, messageTemplate, null); } }
public bool IsEnabled(LogLevel logLevel) { var level = ConvertLogLevel(logLevel); return(_logger.IsEnabled(level)); }