示例#1
0
        public LogRecordModel InsertLog(LogLevel logLevel, string shortMessage, string fullMessage = "",
                                        Guid contextId = new Guid())
        {
            var lr = new LogRecordModel
            {
                LogLevel     = logLevel,
                ShortMessage = shortMessage,
                FullMessage  = fullMessage,
                ContextId    = contextId
            };

            _logRecordRepository.Create(lr);
            return(lr);
        }
示例#2
0
        private void LogProductQuoteCalc(ProductQuote productQuote, string messageTitle)
        {
            var jsonProductQuote = Newtonsoft.Json.JsonConvert.SerializeObject(productQuote);

            var log = new LogRecord
            {
                LogLevel     = LogLevel.Information,
                ShortMessage = messageTitle + " - (Cliente: " + productQuote.CustomerName + " - Producto: " + productQuote.ProductName + ")",
                FullMessage  = jsonProductQuote,
                CreatedOnUtc = DateTime.Now
            };

            logRecordRepository.Create(log);
        }