当前位置: 首页>>代码示例>>C#>>正文


C# LoggingEvent.GetLoggingEventData方法代码示例

本文整理汇总了C#中log4net.Core.LoggingEvent.GetLoggingEventData方法的典型用法代码示例。如果您正苦于以下问题:C# LoggingEvent.GetLoggingEventData方法的具体用法?C# LoggingEvent.GetLoggingEventData怎么用?C# LoggingEvent.GetLoggingEventData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在log4net.Core.LoggingEvent的用法示例。


在下文中一共展示了LoggingEvent.GetLoggingEventData方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

        public void Update(HttpContextBase context, LoggingEvent loggingEvent)
        {
            if (loggingEvent == null)
            {
                throw new ArgumentNullException("loggingEvent");
            }
            LoggingEventData data = loggingEvent.GetLoggingEventData();
            Exception exception = loggingEvent.ExceptionObject;
            string requestUrl = GetRawUrl(context);

            var json = new
            {
                date = data.TimeStamp.ToInvariantString(),
                thread = data.ThreadName,
                level = data.Level.DisplayName,
                logger = data.LoggerName,
                message = data.Message,
                exception = exception == null ? null : new
                {
                    message = exception.Message,
                    stackTrace = exception.StackTrace,
                    sql = exception.Data["SQL"]
                },
                requestUrl
            };
            hub.Context.Clients.update(json);
        }
开发者ID:bevacqua,项目名称:Swarm,代码行数:27,代码来源:LogRealtimeService.cs

示例2: Append

 protected override void Append(LoggingEvent loggingEvent)
 {
     if (OnLog != null)
     {
         OnLog(string.Format("{0,-5} {1}", loggingEvent.GetLoggingEventData().Level, loggingEvent.MessageObject));
     }
 }
开发者ID:azanium,项目名称:PopBloop-GameServer,代码行数:7,代码来源:LogAppender.cs

示例3: Append

 protected override void Append(LoggingEvent loggingEvent)
 {
     var newData = loggingEvent.GetLoggingEventData();
     newData.Message = Decorate(newData.Message);
     loggingEvent.GetType()
         .GetField("m_data", BindingFlags.NonPublic | BindingFlags.Instance)
         .SetValue(newData, loggingEvent);
     base.Append(loggingEvent);
 }
开发者ID:bleissem,项目名称:sharpsnmplib,代码行数:9,代码来源:IndentableFileAppender.cs

示例4: Append

        protected override void Append(LoggingEvent loggingEvent)
        {
            base.Append(loggingEvent);

            var handler = AppendedFile;
            if (handler != null)
            {
                handler(this, new LoggingDataEventArgs(loggingEvent.GetLoggingEventData()));
            }
        }
开发者ID:Symphony-DAS,项目名称:symphony-core,代码行数:10,代码来源:Logging.cs

示例5: PutToOvermind

        private void PutToOvermind(LoggingEvent loggingEvent)
        {
            var parameters = GetParameters(loggingEvent);

            LoggingEventData data = loggingEvent.GetLoggingEventData();
            DroneLogDto dto = Mapper.Map<LoggingEventData, DroneLogDto>(data);
            dto.Parameters = parameters;

            var client = new MvcClient();
            client.Request(Config.Wcf.OvermindApi.PostLog, dto);
        }
开发者ID:bevacqua,项目名称:Swarm,代码行数:11,代码来源:HttpPutToOvermindAppender.cs

示例6: JsonLoggingEventData

 public JsonLoggingEventData(LoggingEvent loggingEvent)
 {
     var loggingEventData = loggingEvent.GetLoggingEventData(Flags);
     Domain = loggingEventData.Domain;
     ExceptionString = loggingEventData.ExceptionString;
     Level = loggingEventData.Level.DisplayName;
     LoggerName = loggingEventData.LoggerName;
     Message = loggingEventData.Message;
     Properties = loggingEventData.Properties;
     ThreadName = loggingEventData.ThreadName;
     TimeStamp = loggingEventData.TimeStamp.ToString("u");
 }
开发者ID:xpressive-websolutions,项目名称:Xpressive.Home.ProofOfConcept,代码行数:12,代码来源:LoggingHub.cs

示例7: JsonLoggingEventData

 public JsonLoggingEventData(LoggingEvent loggingEvent)
 {
     LoggingEventData loggingEventData = loggingEvent.GetLoggingEventData();
     this.Domain = loggingEventData.Domain;
     this.ExceptionString = loggingEventData.ExceptionString;
     this.Identity = loggingEventData.Identity;
     this.Level = new JsonLevel(loggingEventData.Level);
     this.LocationInfo = new JsonLocationInfo(loggingEventData.LocationInfo);
     this.LoggerName = loggingEventData.LoggerName;
     this.Message = loggingEventData.Message;
     this.Properties = loggingEventData.Properties;
     this.ThreadName = loggingEventData.ThreadName;
     this.TimeStamp = loggingEventData.TimeStamp;
     this.UserName = loggingEventData.UserName;
 }
开发者ID:JohnOnTheWeb,项目名称:log4net.SignalR,代码行数:15,代码来源:JsonLoggingEventData.cs

示例8: Append

        protected override void Append(LoggingEvent loggingEvent)
        {
            var loggingEventData = loggingEvent.GetLoggingEventData();

            if (loggingEventData.Message.Contains(ParameterStart))
            {
                var messageBuilder = new StringBuilder();

                var message = loggingEventData.Message;
                var queries = Regex.Split(message, @"command\s\d+:");

                foreach (var query in queries)
                {
                    messageBuilder.Append(ReplaceQueryParametersWithValues(query));
                }

                loggingEventData.Message = messageBuilder.ToString();
            }

            base.Append(new LoggingEvent(loggingEventData));
        }
开发者ID:joaofx,项目名称:felice,代码行数:21,代码来源:NHibernateSqlAppender.cs

示例9: Append

    /// <summary>
    /// Writes the logging event to the zeromq publisher socket.
    /// </summary>
    /// <param name="logging_event">
    /// The event to log.
    /// </param>
    /// <remarks>
    /// The event is not writted to the zeromq publisher socket immediatelly,
    /// instead, we store it in a memory and returns. A dedicated thread (
    /// possibly from the thead pool) is the responsible to remove the logging
    /// event from the memory and dispatch to the zeromq socket.
    /// </remarks>
    protected override void Append(LoggingEvent logging_event) {
      LoggingEventData logging_event_data = logging_event.GetLoggingEventData();

      #region : logging :
      if (LogLog.IsDebugEnabled) {
        LogLog.Debug(declaring_type_, "Appending\r\n"
          + "message:" + logging_event_data.Message
            + "timestamp:" +
              logging_event_data.TimeStamp.ToString("yyyy-mm-dd hh:MM:ss")
                + "level:" + logging_event_data.Level);
      }
      #endregion

      LogMessage message = new LogMessage.Builder()
        .SetLevel(logging_event_data.Level.ToString())
        .SetMessage(logging_event_data.Message)
        .SetException(logging_event_data.ExceptionString)
        .SetTimeStamp(TimeUnitHelper.ToUnixTime(logging_event_data.TimeStamp))
        .Build();
      mailbox_.Send(message);
    }
开发者ID:joethinh,项目名称:nohros-must,代码行数:33,代码来源:PublisherAppender.cs


注:本文中的log4net.Core.LoggingEvent.GetLoggingEventData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。