Beispiel #1
0
        private void WriteException(Exception exception, Config.LogLevelEnum logLevel)
        {
            Log.Write(_connection, exception.Message, typeof(Heart), exception.StackTrace, logLevel);

            if (exception.InnerException != null)
            {
                WriteException(exception.InnerException, logLevel);
            }
        }
Beispiel #2
0
        public static void Write(MongoConnection connection, string message, Type location, string stackTrace, Config.LogLevelEnum logLevel)
        {
            if (WriteLogLevel.HasFlag(logLevel))
            {
                Log log = new Log()
                {
                    CreatedTime = DateTime.Now,
                    Message     = message,
                    Location    = location.Name,
                    StackTrace  = stackTrace,
                    LogLevel    = logLevel,
                };

                if (IsRepeatedMessage(log) == false)
                {
                    log.Insert(connection);
                }
            }
        }
Beispiel #3
0
 public static void Write(MongoConnection connection, string message, Type location, Config.LogLevelEnum logLevel)
 {
     Write(connection, message, location, string.Empty, logLevel);
 }
Beispiel #4
0
        private static void Write(MongoConnection connection, string message, string location, string stackTrace, Config.LogLevelEnum logLevel)
        {
            Log log = new Log()
            {
                CreatedTime = DateTime.Now,
                Message     = message,
                Location    = location,
                StackTrace  = stackTrace,
                LogLevel    = logLevel,
            };

            log.Insert(connection);
        }