Example #1
0
        /// <summary>
        ///     Logs the specified level.
        /// </summary>
        /// <param name="level">The level.</param>
        /// <param name="message">The message.</param>
        /// <param name="jinyinmaoGrain"></param>
        /// <param name="tag">The tag.</param>
        /// <param name="errorCode">The error code.</param>
        /// <param name="errorCodeMessage">The error code message.</param>
        /// <param name="traceEntry">The trace entry.</param>
        /// <param name="exception">The exception.</param>
        /// <param name="payload">The payload.</param>
        public void Log(int level, string message, IJinyinmaoGrain jinyinmaoGrain, string tag = "None", ulong errorCode = 0UL, string errorCodeMessage = "", TraceEntry traceEntry = null, Exception exception = null, Dictionary <string, object> payload = null)
        {
            switch (level)
            {
            case 1:
                this.Critical(message, jinyinmaoGrain, tag, errorCode, errorCodeMessage, traceEntry, exception, payload);
                break;

            case 2:
                this.Error(message, jinyinmaoGrain, tag, errorCode, errorCodeMessage, traceEntry, exception, payload);
                break;

            case 3:
                this.Warning(message, jinyinmaoGrain, tag, errorCode, errorCodeMessage, traceEntry, exception, payload);
                break;

            case 4:
                this.Info(message, jinyinmaoGrain, tag, errorCode, errorCodeMessage, traceEntry, exception, payload);
                break;

            case 5:
                this.Verbose(message, jinyinmaoGrain, tag, errorCode, errorCodeMessage, traceEntry, exception, payload);
                break;

            default:
                this.Verbose(message, jinyinmaoGrain, tag, errorCode, errorCodeMessage, traceEntry, exception, payload);
                break;
            }
        }
        /// <summary>
        ///     Logs the message at the <c>Error</c> level.
        /// </summary>
        /// <param name="jinyinmaoGrain">The jinyinmaoGrain.</param>
        /// <param name="message">The message.</param>
        /// <param name="tag">The tag.</param>
        /// <param name="errorCode">The error code.</param>
        /// <param name="errorCodeMessage">The error code message.</param>
        /// <param name="traceEntry">The trace entry.</param>
        /// <param name="exception">The exception.</param>
        /// <param name="payload">The payload.</param>
        public static void Error(this IJinyinmaoGrain jinyinmaoGrain, string message, string tag = "Orleans Grain Log", ulong errorCode = 0UL, string errorCodeMessage = "", TraceEntry traceEntry = null, Exception exception = null, Dictionary <string, object> payload = null)
        {
            if (traceEntry == null)
            {
                traceEntry = RequestContext.Get("TraceEntry") as TraceEntry;
            }

            jinyinmaoGrain.Logger.Error(message, jinyinmaoGrain, tag, errorCode, errorCodeMessage, traceEntry, exception, payload);
        }
Example #3
0
        /// <summary>
        ///     Informations the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="jinyinmaoGrain"></param>
        /// <param name="tag">The tag.</param>
        /// <param name="errorCode">The error code.</param>
        /// <param name="errorCodeMessage">The error code message.</param>
        /// <param name="traceEntry">The trace entry.</param>
        /// <param name="exception">The exception.</param>
        /// <param name="payload">The payload.</param>
        public void Info(string message, IJinyinmaoGrain jinyinmaoGrain, string tag = "None", ulong errorCode = 0UL, string errorCodeMessage = "", TraceEntry traceEntry = null, Exception exception = null, Dictionary <string, object> payload = null)
        {
            MessageContent logMessageContent = BuildLogMessageContent(message, jinyinmaoGrain, tag, errorCode, errorCodeMessage, traceEntry, exception, payload);

            Trace.TraceInformation(logMessageContent.ToJson());
        }
Example #4
0
 /// <summary>
 ///     Verboses the specified message.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="jinyinmaoGrain"></param>
 /// <param name="tag">The tag.</param>
 /// <param name="errorCode">The error code.</param>
 /// <param name="errorCodeMessage">The error code message.</param>
 /// <param name="traceEntry">The trace entry.</param>
 /// <param name="exception">The exception.</param>
 /// <param name="payload">The payload.</param>
 public void Verbose(string message, IJinyinmaoGrain jinyinmaoGrain, string tag = "None", ulong errorCode = 0UL, string errorCodeMessage = "", TraceEntry traceEntry = null, Exception exception = null, Dictionary <string, object> payload = null)
 {
 }
 /// <summary>
 ///     Logs the message at the <c>Error</c> level.
 /// </summary>
 /// <param name="jinyinmaoGrain">The jinyinmaoGrain.</param>
 /// <param name="message">The message.</param>
 /// <param name="exception">The exception.</param>
 public static void Error(this IJinyinmaoGrain jinyinmaoGrain, string message, Exception exception)
 {
     jinyinmaoGrain.Critical(message, "Orleans Grain Log", 0UL, "", null, exception);
 }
Example #6
0
        /// <summary>
        ///     Logs the message at the <c>Info</c> level.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="jinyinmaoGrain"></param>
        /// <param name="tag">The tag.</param>
        /// <param name="errorCode">The error code.</param>
        /// <param name="errorCodeMessage">The error code message.</param>
        /// <param name="traceEntry">The trace entry.</param>
        /// <param name="exception">The exception.</param>
        /// <param name="payload">The payload.</param>
        public void Info(string message, IJinyinmaoGrain jinyinmaoGrain, string tag = "None", ulong errorCode = 0UL, string errorCodeMessage = "", TraceEntry traceEntry = null, Exception exception = null, Dictionary <string, object> payload = null)
        {
            LogEntry logEntry = BuildLogEntry(4, message, jinyinmaoGrain, tag, errorCode, errorCodeMessage, traceEntry, exception, payload);

            this.Logger.Info(logEntry.ToJson());
        }