public void Append_Appending_CallsShipperWithCorrectValues() { _target.DoAppend(GetLoggingEventWithSomeData()); _target.Close(); _shipper.Received().Ship(Arg.Is <LogzioLoggingEvent>(x => (string)x.LogData["domain"] == "Such domain"), Arg.Any <ShipperOptions>()); }
public void Sanity() { var hierarchy = (Hierarchy)LogManager.GetRepository(Assembly.GetCallingAssembly()); var logzioAppender = new LogzioAppender(); logzioAppender.AddToken("iWnDeXJFJtuEPPcgWRDpkCdkBksbrUAO"); logzioAppender.AddListenerUrl(LogzioListenerDummy.DefaultUrl); hierarchy.Root.AddAppender(logzioAppender); hierarchy.Configured = true; var logger = LogManager.GetLogger(typeof(Log4NetSanityTests)); logger.Info("Just a random log line"); new Bootstraper().Resolve <IShipper>().WaitForSendLogsTask(); logzioAppender.Close(); LogManager.Shutdown(); _dummy.Requests.Count.ShouldBe(1); _dummy.Requests[0].ShouldContain("Just a random log line"); }
public void Sanity() { var hierarchy = (Hierarchy)LogManager.GetRepository(); var logzioAppender = new LogzioAppender(); logzioAppender.AddToken("DKJiomZjbFyVvssJDmUAWeEOSNnDARWz"); logzioAppender.AddListenerUrl(LogzioListenerDummy.DefaultUrl); hierarchy.Root.AddAppender(logzioAppender); hierarchy.Configured = true; var logger = LogManager.GetLogger(typeof(Log4netSanityTests)); logger.Info("Just a random log line"); new Bootstraper().Resolve <IShipper>().WaitForSendLogsTask(); logzioAppender.Close(); LogManager.Shutdown(); _dummy.Requests.Should().HaveCount(1); _dummy.Requests[0].Should().Match("*Just a random log line*"); }