我们如何在服务堆栈中集成Elmah日志记录 [英] How do we integrate elmah logging in servicestack

查看:62
本文介绍了我们如何在服务堆栈中集成Elmah日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是服务堆栈和elman日志记录的新手。

I am new to servicestack and elman logging.

任何人都可以建议我们如何将Elmah集成到服务堆栈应用程序中。

Can any body suggest how do we integrate elmah in service stack applications.

谢谢...

推荐答案

如果您有现有的日志记录解决方案,则可以使用 ServiceStack.Logging.Elmah 项目。可通过NuGet使用。

If you have an existing logging solution then you can use the ServiceStack.Logging.Elmah project. It is available via NuGet.

除了原本打算使用的记录器之外,异常,错误和致命的呼叫也将记录到Elmah。对于所有其他日志类型,仅使用原始记录器。

Exceptions, errors and fatal calls will be logged to Elmah in addition to the originally intended logger. For all other log types, only the original logger is used.

因此,如果您已经在使用Log4Net,则可以像这样配置Elmah

So if you are already using Log4Net then you can just configure Elmah like this

ElmahLogFactory factory = new ElmahLogFactory(new Log4NetFactory());

如果您不希望覆盖现有日志,则可以研究将Elmah添加到任何ASP.NET网站。没有理由仅仅因为您正在使用ServiceStack而无法正常工作。

If you don't want to wrap in over an existing log then you can just research adding Elmah to any ASP.NET website. There is no reason it wouldn't work just because you are using ServiceStack.

这篇关于我们如何在服务堆栈中集成Elmah日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆