Skip to content

Instantly share code, notes, and snippets.

@pichayean
Created April 26, 2021 14:17
Show Gist options
  • Save pichayean/de0b94753f62b714229277119fc847b1 to your computer and use it in GitHub Desktop.
Save pichayean/de0b94753f62b714229277119fc847b1 to your computer and use it in GitHub Desktop.
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace Webapi_Serilog.Controllers
{
[ApiController]
[Route("[controller]")]
public class KibanaLogController : ControllerBase
{
private readonly ILogger<KibanaLogController> _logger;
public KibanaLogController(ILogger<KibanaLogController> logger)
{
_logger = logger;
}
[HttpGet]
[Route("CreateInformationLog")]
public IActionResult Get()
{
_logger.LogInformation("_Log Testing {date}", DateTime.UtcNow);
return Ok(new { status = "Hello" });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment