Last active
August 29, 2015 14:07
-
-
Save SamLeach/406ef028816d333e851f to your computer and use it in GitHub Desktop.
HomeController log4mongo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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