Exemplo n.º 1
0
        protected object LogMessageAndGetResult(LogMessageDetail messageDetail)
        {
            var logLevel = messageDetail.GetLogLevel();

            _logger.Log(logLevel, "level: {logLevel}, detail: {messageDetail}", logLevel, messageDetail);

            return(new
            {
                LogLevel = $"{(int)logLevel} {logLevel}",
                DateTime = DateTime.Now,
                Detail = messageDetail
            });
        }
 public IActionResult LogMessage([FromBody] LogMessageDetail messageDetail)
 {
     return(Ok(LogMessageAndGetResult(messageDetail)));
 }