the name is the fully qualified classname.If you want something different, then you should create an ILoggerFactory that will do what you want it to do. take a peek into the existing Log4Net integration's ILoggerFactory implementation to get started
On Fri, Oct 16, 2009 at 12:19 PM, Sosh <bgs...@gmail.com> wrote: > > Hi Ken, > > I'm not using container.Resolve. I'm using the built in logging > facility in Windsor. So in my container initialisation I have > something like: > > container.AddFacility("logging", new LoggingFacility > (LoggerImplementation.Log4net)); > > And then in my consuming classed, I just have: > > public ILogger Logger > > which windsor injects into. > > This is working fine, but as far as I can see I have no control over > which *named* logger this is using. > > Thanks, > > S > > On Oct 16, 11:20 am, Ken Egozi <egoz...@gmail.com> wrote: > > 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 <bgs...@gmail.com> 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/bloghttp://www.delver.comhttp://www.musicglue.comhttp://www.castleproject.orghttp://www.idcc.co.il-הכנס > הקהילתי הראשון למפתחי דוטנט - בואו בהמוניכם > > > -- 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 castle-project-users@googlegroups.com To unsubscribe from this group, send email to castle-project-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---