예제 #1
0
        /// <summary>Initializes a new instance of the Diligent.Poced.Logging.PerfTracker class.</summary>
        ///
        /// <param name="logger">   The logger.</param>
        /// <param name="name">     The name.</param>
        /// <param name="userId">   Identifier for the user.</param>
        /// <param name="userName"> Name of the user.</param>
        /// <param name="product">  The product.</param>
        /// <param name="location"> The location.</param>
        /// <param name="layer">    The layer.</param>
        public PerfTracker(IPocedLogger logger, string name, string userId, string userName,
                           string product, string location, string layer)
        {
            this.logger = logger;
            sw          = Stopwatch.StartNew();
            infoToLog   = new LogDetail
            {
                Message  = name,
                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) }
            };
        }
예제 #2
0
 public void WritePerf(LogDetail detail, LogLevel level = LogLevel.Information)
 {
     perfLogger.Write(levelMap[level], "{@LogDetail}", detail);
 }
예제 #3
0
 public void WriteUsage(LogDetail detail, LogLevel level = LogLevel.Information)
 {
     usageLogger.Write(levelMap[level], "{@LogDetail}", detail);
 }