Example #1
0
 private void LogMessage(System.Diagnostics.TraceEventType eventType, string message)
 {
     Messages.Add(message);
 }
Example #2
0
 /// <exclude />
 static private void LogEntry(string title, string message, Exception exc, Category category, System.Diagnostics.TraceEventType severity)
 {
     LogEntry(title, message, exc, category, severity, -1, 0);
 }
 public override bool ShouldTrace(System.Diagnostics.TraceEventCache?cache, string source, System.Diagnostics.TraceEventType eventType, int id, string?formatOrMessage, object?[]?args, object?data1, object?[]?data)
 {
     throw null;
 }
Example #4
0
 public override void TraceEvent(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string message)
 {
     LogMessage(eventType, message);
 }
 public void TraceData(System.Diagnostics.TraceEventType eventType, int id, params object?[]?data)
 {
 }
 public void TraceEvent(System.Diagnostics.TraceEventType eventType, int id, string?message)
 {
 }
 public void TraceData(System.Diagnostics.TraceEventType eventType, int id, object data)
 {
 }
 public virtual void TraceEvent(System.Diagnostics.TraceEventCache?eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string?message)
 {
 }
Example #9
0
 public override void TraceEvent(System.Diagnostics.TraceEventCache?eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("CompositeFormat")] string?format, params object?[]?args)
 {
 }
 public abstract bool ShouldTrace(System.Diagnostics.TraceEventCache cache, string source, System.Diagnostics.TraceEventType eventType, int id, string formatOrMessage, object[] args, object data1, object[] data);
 public override bool ShouldTrace(System.Diagnostics.TraceEventCache?cache, string source, System.Diagnostics.TraceEventType eventType, int id, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("CompositeFormat")] string?formatOrMessage, object?[]?args, object?data1, object?[]?data)
 {
     throw null;
 }
 public void TraceEvent(System.Diagnostics.TraceEventType type, int id, string message, string member = null, string file = null, int line = 0)
 {
     // No-op!
 }
Example #13
0
 public sealed override void TraceEvent(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id)
 {
 }
 public void WriteException(System.Exception ex, System.Diagnostics.TraceEventType severity, string additionalInfo, int id)
 {
 }
Example #15
0
 public override void TraceData(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType severity, int id, object data)
 {
 }
 public virtual void TraceData(System.Diagnostics.TraceEventCache?eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, params object?[]?data)
 {
 }
Example #17
0
 public override void TraceEvent(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType severity, int id, string message)
 {
 }
 public virtual void TraceEvent(System.Diagnostics.TraceEventCache?eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string format, params object?[]?args)
 {
 }
Example #19
0
 public override void TraceEvent(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType severity, int id, string format, params object[] args)
 {
 }
 public void TraceEvent(System.Diagnostics.TraceEventType eventType, int id)
 {
 }
Example #21
0
        public override void TraceData(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, object data)
        {
            var logEntry = (Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry)data;

            var fileLogEntry = new LogEntry
            {
                TimeStamp           = logEntry.TimeStamp.Add(TimeZoneAdjustment),
                ApplicationDomainId = AppDomain.CurrentDomain.Id,
                ThreadId            = System.Threading.Thread.CurrentThread.ManagedThreadId,
                Message             = logEntry.Message,
                Severity            = logEntry.Severity.ToString(),
            };

            string title = logEntry.Title;

            title = title.Substring(title.IndexOf(")") + 2); // Removing ({AppDomainId} - {ThreadId}}) prefix.

            // Extracting display options from title
            if (title.StartsWith("RGB("))
            {
                fileLogEntry.DisplayOptions = title.Substring(0, title.IndexOf(")") + 1);
                title = title.Substring(fileLogEntry.DisplayOptions.Length);
            }
            fileLogEntry.Title = title;

            LoggerInstance.WriteEntry(fileLogEntry);
        }
 public void TraceEvent(System.Diagnostics.TraceEventType eventType, int id, string format, params object?[]?args)
 {
 }
Example #23
0
 public bool ServiceError(int TerminalId, string Category, System.Diagnostics.TraceEventType Severity, string ErrorCondition)
 {
     return(base.Channel.ServiceError(TerminalId, Category, Severity, ErrorCondition));
 }
Example #24
0
        public override void TraceData(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, object data)
        {
            var log = data as LogEntry;

            LogEntryFormatter.SetLogFormatter(log, this.Formatter);
            try
            {
                if (log != null && Formatter != null)
                {
                    log.TimeStamp = DateTime.Now;
                    if (ConfigurationManager.LoggingConfigurationManager.DatabaseLogSwitch)
                    {
                        //写入到数据库中
                        LogEntryQueueManager.EnQueueForDbWriter(log);
                    }

                    if (ConfigurationManager.LoggingConfigurationManager.FileLogSwitch)
                    {
                        LogEntryQueueManager.EnQueueForDbWriter(log);
                    }

                    //发送邮件
                    LogEntryQueueManager.EnQueueForEmailSender(log);
                }
                else
                {
                    base.TraceData(eventCache, source, eventType, id, data);
                }

                if (!ConfigurationManager.LoggingConfigurationManager.FileLogSwitch)
                {
                    return;
                }
                _logCount = (_logCount + 1) % _bufferSize;
                if (_logCount == 0)
                {
                    LogEventManager.NotifyWriterLog();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #25
0
 public System.Threading.Tasks.Task <bool> ServiceErrorAsync(int TerminalId, string Category, System.Diagnostics.TraceEventType Severity, string ErrorCondition)
 {
     return(base.Channel.ServiceErrorAsync(TerminalId, Category, Severity, ErrorCondition));
 }
Example #26
0
 public override void TraceEvent(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string format, params object[] args)
 {
     LogMessage(eventType, string.Format(format, args));
 }
Example #27
0
 public override void TraceData(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, params object[] data)
 {
 }
Example #28
0
 /// <exclude />
 public static void LogEntry(string title, string message, Category category, System.Diagnostics.TraceEventType severity, int priority, int eventid)
 {
     LogEntry(title, message, null, category, severity, priority, eventid);
 }
 public bool ShouldTrace(System.Diagnostics.TraceEventType eventType)
 {
     throw null;
 }
Example #30
0
        static private void LogEntry(string title, string message, Exception exc, Category category, System.Diagnostics.TraceEventType severity, int priority, int eventid)
        {
            var entry = new Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry
            {
                Title    = $"({AppDomain.CurrentDomain.Id} - {Thread.CurrentThread.ManagedThreadId}) {title}",
                Message  = message,
                Severity = severity,
                Priority = priority,
                EventId  = eventid
            };

            if ((category & Category.General) != 0)
            {
                entry.Categories.Add(nameof(Category.General));
            }

            if ((category & Category.Audit) != 0)
            {
                entry.Categories.Add(nameof(Category.Audit));
            }

            if (exc != null)
            {
                entry.ExtendedProperties.Add("Exception", exc);
            }

            _resourceLocker.Resources.Writer.Write(entry);
        }
Example #31
0
 protected LogEntry(System.Diagnostics.TraceEventType level, Guid logTypeID)
 {
     this._level = level;
     this._logTypeID = logTypeID;
 }