internal static void LogOnServer(string data, LogEventType eventType, string logComponent, string logSuffixName, FolderTaskLoggerBase.LogType logType, Guid?correlationId = null) { Log log = FolderTaskLoggerBase.InitializeServerLogging(logComponent, logSuffixName, logType); LogRowFormatter logRowFormatter = new LogRowFormatter(FolderTaskLoggerBase.GetLogSchema(logType)); logRowFormatter[2] = eventType; logRowFormatter[5] = data; if (correlationId != null) { logRowFormatter[7] = correlationId; } log.Append(logRowFormatter, 0); }
public virtual LogRowFormatter LogEvent(LogEventType eventType, string data, FolderTaskLoggerBase.LogType logType) { if (string.IsNullOrEmpty(data)) { throw new ArgumentNullException("data"); } Log log = FolderTaskLoggerBase.InitializeServerLogging(this.logComponent, this.logSuffixName, logType); LogRowFormatter logRowFormatter = new LogRowFormatter(FolderTaskLoggerBase.GetLogSchema(logType)); logRowFormatter[2] = eventType; logRowFormatter[3] = this.organizationId.ToString(); logRowFormatter[4] = this.MailboxGuid.ToString(); logRowFormatter[7] = this.CorrelationId.ToString(); logRowFormatter[5] = data; log.Append(logRowFormatter, 0); return(logRowFormatter); }
private static Log InitializeServerLogging(string logComponent, string logSuffixName, FolderTaskLoggerBase.LogType logType) { if (!FolderTaskLoggerBase.initializedLogs.ContainsKey(logSuffixName)) { lock (FolderTaskLoggerBase.initializeLockObject) { if (!FolderTaskLoggerBase.initializedLogs.ContainsKey(logSuffixName)) { Log log = new Log(FolderTaskLoggerBase.GetLogFileName(logSuffixName), new LogHeaderFormatter(FolderTaskLoggerBase.GetLogSchema(logType)), logComponent); log.Configure(Path.Combine(ExchangeSetupContext.InstallPath, FolderTaskLoggerBase.GetLogPath(logType)), FolderTaskLoggerBase.LogMaxAge, 262144000L, 10485760L); FolderTaskLoggerBase.initializedLogs.Add(logSuffixName, log); } } } return(FolderTaskLoggerBase.initializedLogs[logSuffixName]); }