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)); }
public void Log(string message) => _logger.LogInformation(message);