Create a gist now

Instantly share code, notes, and snippets.

HomeController log4mongo
public class HomeController : Controller
{
private readonly ILogger logger;
public HomeController(ILogger logger)
{
XmlConfigurator.Configure();
this.logger = logger;
}
public ActionResult Index()
{
logger.Info("Home");
return View();
}
public ActionResult About()
{
ViewBag.Message = "Your application description page.";
logger.Info("About");
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
logger.Info("Contact");
return View();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment