コード例 #1
0
        /// <summary>
        /// Writes the specified message to the log file.
        /// </summary>
        /// <param name="severity">The log message level.</param>
        /// <param name="messageId">The message id.</param>
        /// <param name="message">The message being logged.</param>
        public void Log(TraceEventType severity, LoggingMessageId messageId, string message)
        {
            DynamicTableEntity logEntity = new DynamicTableEntity()
            {
                PartitionKey = this.TransactionId.ToString(),
                RowKey       = Guid.NewGuid().ToString(),
            };

            logEntity.Properties.Add("TransactionId", EntityProperty.GeneratePropertyForString(this.TransactionId.ToString()));
            logEntity.Properties.Add("LogMessage", EntityProperty.GeneratePropertyForString(message));
            logEntity.Properties.Add("Severity", EntityProperty.GeneratePropertyForString(severity.ToString()));
            logEntity.Properties.Add("MessageId", EntityProperty.GeneratePropertyForString(messageId.ToString()));

            this.cloudTable.Execute(TableOperation.Insert(logEntity));
        }
コード例 #2
0
ファイル: Logger.cs プロジェクト: richstep/TVWS-DB-Code
        /// <summary>
        /// Writes the specified message to the log file.
        /// </summary>
        /// <param name="severity">The log message level.</param>
        /// <param name="messageId">The message id.</param>
        /// <param name="message">The message being logged.</param>
        public void Log(TraceEventType severity, LoggingMessageId messageId, string message)
        {
            LogEntry entry = new LogEntry()
            {
                Message    = message,
                EventId    = (int)messageId,
                Severity   = severity,
                ActivityId = this.TransactionId,
                Title      = this.UserId
            };

            entry.Categories.Add("General");
            entry.ExtendedProperties.Add("TransactionId", this.TransactionId);
            Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(entry);
        }
コード例 #3
0
 /// <summary>
 /// Logs the specified message if the current configured logging level is less than the passed in log level.
 /// </summary>
 /// <param name="level">The logging level of the new entry (used to determine if message is to be logged).</param>
 /// <param name="userName">The registered user who made the call.</param>
 /// <param name="msgId">The message Id</param>
 /// <param name="logMessage">The message that is to be logged.</param>
 /// <param name="transactionId">The TransactionId that is to be logged.</param>
 public void Log(LoggingLevel level, string userName, LoggingMessageId msgId, string logMessage, Guid transactionId)
 {
 }
コード例 #4
0
ファイル: Logger.cs プロジェクト: richstep/TVWS-DB-Code
 /// <summary>
 /// Logs the specified message if the current configured logging level is less than the passed in log level.
 /// </summary>
 /// <param name="level">The logging level of the new entry (used to determine if message is to be logged).</param>
 /// <param name="userName">The registered user who made the call.</param>
 /// <param name="msgId">The message Id</param>
 /// <param name="logMessage">The message that is to be logged.</param>
 /// <param name="transactionId">The TransactionId that is to be logged.</param>
 public void Log(LoggingLevel level, string userName, LoggingMessageId msgId, string logMessage, Guid transactionId)
 {
     throw new NotImplementedException();
 }