Пример #1
0
        public EventModel(Event e)
        {
            if (e == null)
            {
                throw new ArgumentNullException (nameof (e));
            }

            Id = e.Id;
            Level = e.Level;
            Logger = e.Logger;
            Thread = e.Thread;
            Time = e.Time;
            Message = e.Message;
            Throwable = e.Throwable;
            Properties = e.GetProperties ();
        }
Пример #2
0
        private static void PrintEvent(Event @event)
        {
            var level = @event.Level;
            var logger = @event.Logger;
            var thread = @event.Thread;
            var message = @event.Message;
            var throwable = @event.Throwable;
            var time = @event.Time;
            var id = @event.Id;

            const string format = "{5}. {0:yyyy-MM-dd hh:mm:ss.fff} [{1}] {2} ({3}) {4}";
            Console.WriteLine (format, time, level, logger, thread, message, id);
            if (!String.IsNullOrWhiteSpace (throwable))
            {
                Console.WriteLine (throwable);
            }
        }
Пример #3
0
 public bool Apply(Event @event)
 {
     GuardState ();
     return Log4JParserC.Log4JFilterApply (impl_, @event.Handle);
 }