do not contaier.Resolve<ILogger>().the whole idea is to have windsor deal
with it - by having a component dependent on ILogger, and have Windsor
resolve it.
Say:
namespace A
{
public class B
{
ILogger logger;
public B(ILogger logger) { this.logger = logger };
}
}
Assuming you Resolve<A.B>() (or otherwise have B as a dependency on
somehting else), the logger instance will have the name A.B
if you *have* to get hold of a logger instance directly (say on the
application's entry point), you should resolve the ILoggerFactory, and have
it create the proper named instance:
var logger = container.Resolve<ILoggerFactory>().Create(typeof(A.B));
I have a couple of blog posts on that exact topic, awaiting to be finalized
and published (no time though)
On Fri, Oct 16, 2009 at 9:51 AM, Sosh <[email protected]> wrote:
>
> Hi,
>
> I've set up the Windsor logging facility, and have it working with
> log4net. However, I can't figure out how to specify which named
> logger the messages should go to - how do I do this? (At the moment
> they seem to just go to root)
>
> Thanks,
>
> S
>
> >
>
--
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.idcc.co.il - הכנס הקהילתי הראשון למפתחי דוטנט - בואו בהמוניכם
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---