コード例 #1
0
ファイル: Flogger.cs プロジェクト: lythix/flogger
        public static void WriteDiagnostic(FlogInfo infoToLog)
        {
            var writeDiagnostics = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableDiagnostics"]);

            if (!writeDiagnostics)
            {
                return;
            }

            _diagnosticLogger.Write(LogEventLevel.Information, "{@FlogInfo}", infoToLog);
        }
コード例 #2
0
ファイル: PerfTracker.cs プロジェクト: lythix/flogger
        public PerfTracker(string name, string userId, string userName, string location, string product, string layer)
        {
            _sw        = Stopwatch.StartNew();
            _infoToLog = new FlogInfo()
            {
                Message  = name,
                UserId   = userId,
                UserName = userName,
                Product  = product,
                Layer    = layer,
                Location = location,
                Hostname = Environment.MachineName
            };

            _beginTime = DateTime.Now;
            _details   = new Dictionary <string, object>();
        }
コード例 #3
0
ファイル: Flogger.cs プロジェクト: lythix/flogger
 public static void WriteError(FlogInfo infoToLog)
 {
     infoToLog.Message = GetMessageFromException(infoToLog.Exception);
     _errorLogger.Write(LogEventLevel.Information, "{@FlogInfo}", infoToLog);
 }
コード例 #4
0
ファイル: Flogger.cs プロジェクト: lythix/flogger
 public static void WriteUsage(FlogInfo infoToLog)
 {
     _usageLogger.Write(LogEventLevel.Information, "{@FlogInfo}", infoToLog);
 }
コード例 #5
0
ファイル: Flogger.cs プロジェクト: lythix/flogger
 public static void WritePerf(FlogInfo infoToLog)
 {
     _perfLogger.Write(LogEventLevel.Information, "{@FlogInfo}", infoToLog);
 }