예제 #1
0
        public IActionResult Get(int id)
        {
            // 演示日志输出
            _logger.LogInformation("This is Information Log!");
            _logger.LogWarning("This is Warning Log!");
            _logger.LogError("This is Error Log!");
            _service.Log("service log");
            var user = new User()
            {
                Id = id, Name = "Name:" + id, Sex = "Male"
            };

            return(View(user));
        }
예제 #2
0
 public void Log(string message) => _logger.LogInformation(message);