Beispiel #1
0
        protected override void Append(LoggingEvent loggingEvent)
        {
            _loggingEvent = loggingEvent;
            // append the level message and the content to one string
            //string message = string.Format("{0}, {1}",
            //loggingEvent.Level.DisplayName,
            //loggingEvent.RenderedMessage);
            LogServiceMessage message = new LogServiceMessage()
            {
                TransDate     = DateTime.Now,
                LogLevel      = LogLevel,
                LogingName    = LogingName,
                OICUserId     = OICUserId,
                DeptCode      = DeptCode,
                CompanyCode   = CompanyCode,
                SystemCode    = SystemCode,
                SubSystemCode = SubSystemCode,
                PrgId         = PrgId,
                IpAddress     = IPAddress,
                LogHeader     = LogHeader,
                Detail        = Detail,
                CreateDate    = CreatedDate,
                CreateBy      = CreatedBy
            };

            if (loggingEvent.ExceptionObject != null)
            {
                message.LogException = loggingEvent.ExceptionObject.Message;
            }

            // send this string message to wcf service
            Service.NewLog(message);
        }