关于标题总结了我想要实现的目标,虽然现在我发布了一些代码,但我也想知道 LogFactory 是否在正确的位置。
谢谢你,斯蒂芬
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)
{
}