Beispiel #1
0
        public async Task When_logging_events_through_appender()
        {
            var appender = new HTTPAppender
            {
                Name     = "Tester",
                Endpoint = "http://localhost:1234"
            };

            appender.DoAppend(new LoggingEvent(new LoggingEventData
            {
                Message         = "Foo",
                ExceptionString = "foo",
                LoggerName      = "boo",
                Level           = Level.Debug,
                TimeStampUtc    = DateTime.UtcNow,
                ThreadName      = "12"
            }));

            appender.DoAppend(new LoggingEvent(new LoggingEventData {
                Message = "Bar"
            }));
            appender.DoAppend(new LoggingEvent(new LoggingEventData {
                Message = "Baz"
            }));

            await Task.Delay(TimeSpan.FromSeconds(1));

            appender.Close();
        }