打印到DotNetNuke的事件日志/查看器 [英] Print to DotNetNuke Event Log/Viewer

查看:99
本文介绍了打印到DotNetNuke的事件日志/查看器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关调试的目的,我怎么能打印到事件日志/查看器在DotNetNuke的,使用VB.NET或C#?

For debugging purposes, how can I print to the event log/viewer in DotNetNuke, using VB.NET or C#?

推荐答案

:// WWW .ventrian.com /资源/文章/ tabid / 213 / articleType / ArticleView /条款ArticleID / 330 /日志记录到最EventLog.aspx (只是文章的相关部分):

From http://www.ventrian.com/Resources/Articles/tabid/213/articleType/ArticleView/articleId/330/Logging-to-the-EventLog.aspx (just the relevant part of the article):

使用事件日志中的代码是相当
简单,将码如下: -

Using the event log in code is quite simple, the code is as follows:-

首先,创建$ b $的一个实例b EventLogViewer ...

First, create an instance of the EventLogViewer...

Dim objEventLog As New DotNetNuke.Services.Log.EventLog.EventLogController

接下来,登录您希望
陷阱事件...

Next, log the event you wish to trap...

objEventLog.AddLog("Sample Message",
    "Something Interesting Happened!",
    PortalSettings,
    -1,
    DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT)

现在,当这个代码运行,事件
日志条目应该会出现在管理 - >
日志查看器!您可以自定义事件,这些
型,无论是管理,
主机,产品的更新等。

Now, when this code is run, the event log entry should appear in admin -> log viewer! You can customise these type of events, whether they be admin, host, item updated, etc.

这篇关于打印到DotNetNuke的事件日志/查看器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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