I have done this before with StructureMap and now I wish to do the same with Windsor Castle. Does anyone know how to do it?
Registry.For<ILogger>().Use(s =>
new Logger(s.ParentType ?? s.BuildStack.Current.ConcreteType));
Well, I got some help from a team member instead that has been using Windsor Castle.
This is how it need to be written.
Component.For<ILogger>().UsingFactoryMethod((m, v, i) =>
new Logger(i.Handler.ComponentModel.Implementation.Name)
).LifeStyle.Transient