예제 #1
0
        /// <summary>
        /// Preparing correct message to log
        /// </summary>
        /// <param name="dto">Client info to logging</param>
        /// <returns>message with basic information to log</returns>
        private string PrepareMessage(LogDTO dto)
        {
            string message = string.Empty;

            if (!string.IsNullOrEmpty(dto.Message))
            {
                message += dto.Message;
            }
            if (!string.IsNullOrEmpty(dto.Function))
            {
                message = dto.Function + (dto.Function.EndsWith(")") ? "" : "()") + "|" + message;
            }
            if (!string.IsNullOrEmpty(dto.Module))
            {
                message = dto.Module + "|" + message;
            }

            message = GetClientEndpoint() + "|" + message;

            return(message);
        }
예제 #2
0
        /// <summary>
        /// Add trace log
        /// </summary>
        /// <param name="dto">Client info to logging</param>
        public void Trace(LogDTO dto)
        {
            string message = PrepareMessage(dto);

            _logger.Trace(message);
        }
예제 #3
0
        /// <summary>
        /// Add info log
        /// </summary>
        /// <param name="dto">Client info to logging</param>
        public void Info(LogDTO dto)
        {
            string message = PrepareMessage(dto);

            _logger.Info(message);
        }
예제 #4
0
        /// <summary>
        /// Add fatal log
        /// </summary>
        /// <param name="dto">Client info to logging</param>
        public void Fatal(LogDTO dto)
        {
            string message = PrepareMessage(dto);

            _logger.Fatal(message);
        }
예제 #5
0
        /// <summary>
        /// Add error log
        /// </summary>
        /// <param name="dto">Client info to logging</param>
        public void Error(LogDTO dto)
        {
            string message = PrepareMessage(dto);

            _logger.Error(message);
        }
예제 #6
0
        /// <summary>
        /// Add debug log
        /// </summary>
        /// <param name="dto">Client info to logging</param>
        public void Debug(LogDTO dto)
        {
            string message = PrepareMessage(dto);

            _logger.Debug(message);
        }
예제 #7
0
        /// <summary>
        /// Add warn log
        /// </summary>
        /// <param name="dto">Client info to logging</param>
        public void Warn(LogDTO dto)
        {
            string message = PrepareMessage(dto);

            _logger.Warn(message);
        }