Esempio n. 1
0
        public static void WriteDiagnostic(AcmLoggingDetail infoToLog)
        {
            var writeDiagnostics = true;

            if (!writeDiagnostics)
            {
                return;
            }

            _diagnosticLogger.Write(LogEventLevel.Information, "{@AcmLoggingDetail}", infoToLog);
        }
Esempio n. 2
0
        public static void WriteError(AcmLoggingDetail infoToLog)
        {
            if (infoToLog.Exception != null)
            {
                var procName = FindProcName(infoToLog.Exception);
                infoToLog.Location = string.IsNullOrEmpty(procName) ? infoToLog.Location : procName;
                infoToLog.Message  = GetMessageFromException(infoToLog.Exception);
            }

            _errorLogger.Write(LogEventLevel.Information, "{@AcmLoggingDetail}", infoToLog);
        }
Esempio n. 3
0
        public PerformanceTracker(string message, string userId, string userName, string location, string product, string layer)
        {
            _stopwatch = Stopwatch.StartNew();
            _infoToLog = new AcmLoggingDetail()
            {
                Message  = message,
                UserId   = userId,
                UserName = userName,
                Product  = product,
                Layer    = layer,
                Location = location,
                Hostname = Environment.MachineName
            };

            var beginTime = DateTime.Now;

            _infoToLog.AdditionalInfo = new Dictionary <string, object>()
            {
                { "Started", beginTime.ToString(CultureInfo.InvariantCulture) }
            };
        }
Esempio n. 4
0
 public static void WriteUsage(AcmLoggingDetail infoToLog)
 {
     _usageLogger.Write(LogEventLevel.Information, "{@AcmLoggingDetail}", infoToLog);
 }
Esempio n. 5
0
 public static void WritePerformance(AcmLoggingDetail infoToLog)
 {
     _performanceLogger.Write(LogEventLevel.Information, "{@AcmLoggingDetail}", infoToLog);
 }