public static LoggerConfiguration SherlockSink( this LoggerSinkConfiguration loggerConfiguration, ISherlockClient client, int flushTimeout, IFormatProvider formatProvider = null) { return(loggerConfiguration.Sink(new SherlockEventSink(client, flushTimeout, formatProvider))); }
public static void Start(ISherlockClient client) { SherlockClient = client; _reporter = Actor.SpawnNamed( Actor.FromProducer(() => new BackgroundMessagesReporter(client)), "sherlock-reporter" ); }
public SherlockBackgroundLogReporter( ISherlockClient client, IFormatProvider formatProvider, int flushInterval ) { _client = client; _formatProvider = formatProvider; _flushInterval = flushInterval; }
public DemoEngine(ISherlockClient client) { var props = Actor.FromProducer(() => new DemoRootActor()); _root = Actor.SpawnNamed(props, "Demo"); _sherlock = Actor.SpawnNamed( Actor.FromProducer(() => new ProtoActor.SherlockInspectionActor(new SimpleScheduler(), client)), "Sherlock" ); _sherlock.Tell(new AddToInspection() { Actor = _root }); }
private static void ConfigureLogging() { var serilogConfig = new LoggerConfiguration() .ReadFrom.Configuration(_config); var sherlockOptions = SherlockDemoClientOptions.LoadFrom(_config); if (sherlockOptions.Enabled) { SherlockSettings.Enable(); _sherlockClient = new SherlockClient(sherlockOptions); serilogConfig = serilogConfig.WriteTo.SherlockSink(_sherlockClient, sherlockOptions.FlushIntervalSeconds); ActorMessages.Start(_sherlockClient); } Log.Logger = serilogConfig.CreateLogger(); Proto.Log.SetLoggerFactory(new LoggerFactory().AddSerilog()); }
public SherlockEventSink(ISherlockClient client, int flushTimeout, IFormatProvider formatProvider) { _reporter = Actor.Spawn(Actor.FromProducer(() => new SherlockBackgroundLogReporter(client, formatProvider, flushTimeout))); }
public SherlockInspectionActor(ISimpleScheduler scheduler, ISherlockClient client) { _scheduler = scheduler; _client = client; }
public BackgroundMessagesReporter(ISherlockClient client) { _client = client; _scheduler = new SimpleScheduler(); }