Exemplo n.º 1
0
        public static void LogException(RmsClientManagerLog.RmsClientManagerFeature clientManagerFeature, RmsClientManagerContext context, Exception ex)
        {
            if (!RmsClientManagerLog.rmsLogEnabled)
            {
                return;
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            StringBuilder stringBuilder = null;

            if (ex != null)
            {
                stringBuilder = new StringBuilder(ex.Message.Length + ex.GetType().Name.Length + 3);
                stringBuilder.AppendFormat("{0} [{1}]", ex.Message, ex.GetType().Name);
                if (ex.InnerException != null)
                {
                    stringBuilder.AppendFormat("; Inner Exception: {0} [{1}]", ex.InnerException.Message, ex.InnerException.GetType().Name);
                }
            }
            LogRowFormatter logRowFormatter = new LogRowFormatter(RmsClientManagerLog.rmsLogSchema);

            logRowFormatter[1] = clientManagerFeature;
            logRowFormatter[2] = RmsClientManagerLog.RmsClientManagerEvent.Exception;
            Guid transactionId = context.TransactionId;

            logRowFormatter[7] = context.TransactionId.ToString();
            logRowFormatter[6] = context.ContextStringForm;
            if (stringBuilder != null)
            {
                logRowFormatter[5] = stringBuilder.ToString();
            }
            RmsClientManagerLog.Append(logRowFormatter);
        }
Exemplo n.º 2
0
        private static void LogEvent(RmsClientManagerLog.RmsClientManagerFeature clientManagerFeature, RmsClientManagerLog.RmsClientManagerEvent clientManagerEvent, Guid transaction, string data, string context)
        {
            LogRowFormatter logRowFormatter = new LogRowFormatter(RmsClientManagerLog.rmsLogSchema);

            logRowFormatter[1] = clientManagerFeature;
            logRowFormatter[2] = clientManagerEvent;
            logRowFormatter[7] = transaction.ToString();
            logRowFormatter[6] = context;
            logRowFormatter[5] = data;
            RmsClientManagerLog.Append(logRowFormatter);
        }
Exemplo n.º 3
0
 public static void LogUriEvent(RmsClientManagerLog.RmsClientManagerFeature clientManagerFeature, RmsClientManagerLog.RmsClientManagerEvent clientManagerEvent, RmsClientManagerContext context, Uri serverUrl)
 {
     if (!RmsClientManagerLog.rmsLogEnabled)
     {
         return;
     }
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     RmsClientManagerLog.LogEvent(clientManagerFeature, clientManagerEvent, serverUrl, context.OrgId, context.TransactionId, context.ContextStringForm);
 }
Exemplo n.º 4
0
        private static void LogEvent(RmsClientManagerLog.RmsClientManagerFeature clientManagerFeature, RmsClientManagerLog.RmsClientManagerEvent clientManagerEvent, Uri serverUrl, OrganizationId orgId, Guid transaction, string context)
        {
            LogRowFormatter logRowFormatter = new LogRowFormatter(RmsClientManagerLog.rmsLogSchema);

            logRowFormatter[1] = clientManagerFeature;
            logRowFormatter[2] = clientManagerEvent;
            if (serverUrl != null)
            {
                logRowFormatter[4] = serverUrl.ToString();
            }
            if (orgId != null)
            {
                logRowFormatter[3] = orgId.ToString();
            }
            logRowFormatter[7] = transaction.ToString();
            logRowFormatter[6] = context;
            RmsClientManagerLog.Append(logRowFormatter);
        }