How to use ServiceStack Logging but have it delivered through the IOC container

c3max

New Member
Title about sums up what I'm looking to achieve, although now that I'm posting some code I would also like to know if the LogFactory in the correct place.Thank you,Stephen\[code\]public class ContactAppHost : AppHostBase{ //Tell Service Stack the name of your application and where to find your web services public ContactAppHost() : base("Contact Web Services", typeof (ContactService).Assembly) { // Built into the framework without the IOC LogManager.LogFactory = new NLogFactory(); } public override void Configure(Funq.Container container) { //register any dependencies your services use, e.g: container.Register<ICacheClient>(new MemoryCacheClient()); }}protected void Application_Start(object sender, EventArgs e){ new ContactAppHost().Init();}protected void Application_Error(object sender, EventArgs e){}\[/code\]
 
Back
Top