Esempio n. 1
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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 private static LogSchema GetLogSchema(FolderTaskLoggerBase.LogType logType)
 {
     return(FolderTaskLoggerBase.FolderLogSchema);
 }
Esempio n. 4
0
 private static string GetLogPath(FolderTaskLoggerBase.LogType logType)
 {
     return("Logging\\Folder\\");
 }
Esempio n. 5
0
 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]);
 }