public static void Log(ServiceLogger.LogLevel logLevel, ServiceLogger.Component componentName, LogUploaderEventLogConstants.Message message, string customData, string logFileType, string logFilePath) { ServiceLogger.LogCommon(logLevel, message.ToString(), customData, componentName, logFileType, logFilePath); }
public static void LogCommon(ServiceLogger.LogLevel logLevel, string message, string customData, ServiceLogger.Component componentName = ServiceLogger.Component.None, string logFileType = "", string logFilePath = "") { if (ServiceLogger.serviceLog == null) { ServiceLogger.InitializeMtrtLog(); } if (ServiceLogger.ServiceLogLevel == ServiceLogger.LogLevel.None || logLevel < ServiceLogger.ServiceLogLevel) { return; } LogRowFormatter logRowFormatter = new LogRowFormatter(ServiceLogger.MessageTracingServiceLogSchema); logRowFormatter[1] = logLevel.ToString(); if (!string.IsNullOrEmpty(logFileType)) { string[] array = logFileType.Split(new char[] { '_' }); logRowFormatter[2] = array[0]; } if (!string.IsNullOrEmpty(logFilePath)) { logRowFormatter[3] = logFilePath; } logRowFormatter[4] = componentName.ToString(); logRowFormatter[5] = message; if (!string.IsNullOrEmpty(customData)) { logRowFormatter[6] = customData; } ServiceLogger.serviceLog.Append(logRowFormatter, 0); }
public static void LogError(ServiceLogger.Component componentName, LogUploaderEventLogConstants.Message message, string customData = "", string logFileType = "", string logFilePath = "") { ServiceLogger.Log(ServiceLogger.LogLevel.Error, componentName, message, customData, logFileType, logFilePath); }