Exemplo n.º 1
0
        public void Emit(LogEvent logEvent)
        {
            var Log = new LogMessage
            {
                App       = AppManager.AppUrlFromName(AppName),
                Component = logEvent.Properties.ContainsKey("Component") ? logEvent.Properties["Component"].ToString() : "Unknown",
                Severity  = logEvent.Level.ToString(),
                Timestamp = Timestamp.FromDateTime(logEvent.Timestamp.UtcDateTime),
                Message   = logEvent.RenderMessage()
            };

            foreach (var prop in logEvent.Properties)
            {
                Log.Properties.Add(new LogProperty
                {
                    Key   = prop.Key,
                    Value = prop.Value.ToString()
                });
            }

            Scarif.SendLog(Log);
        }