Hi there,
yesterday I tried to implement log4net for my controllers. As expected
I ran into some problems:
1. When simply using Logger.Debug("bla bla"); the property Logger at
my controller refers to Castle.Core.Logging.NullLogger
2. When trying the suggestion from
http://forum.castleproject.org/viewtopic.php?p=12187
it works. Unfortunately I've found no way to put it into my
BaseController
3. So I tried my luck with windsor: I followed
http://www.castleproject.org/monorail/documentation/trunk/integration/windsor.html
but without Castle.Model.dll (not found in trunk).
I get a compiler error at
protected void RegisterFacilities()
{
throw new Exception("dunno what to do now");
//AddFacility("rails", new RailsFacility());
}
so I commented it out and inserted an exception in order to find out,
if the method is used. I registered two controllers at Windsor:
protected void RegisterComponents()
{
AddComponent("start.controller", typeof(StartController));
AddComponent("login.controller", typeof(LoginController));
}
Everything worked fine (except the logging, but I didn't do anything
for that, yet). So I tried the hint posted at
http://mikehadlow.blogspot.com/2008/06/more-windsor-love-using-log4net.html
When I applied everything there, the exception "dunno what to do now"
was thrown. My logger at login.controller is still NullLogger.
What do I do wrong?
Does it have anything to do with 2.?
What can I do in order to make it work without having to put the code
from 2 into each and every controller?
Thanks in advance,
Flo