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); }
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); }
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); }
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); }