gpt4 book ai didi

ektron - Ektron 中的 EkException 类

转载 作者:行者123 更新时间:2023-12-01 03:58:01 25 4
gpt4 key购买 nike

我在 Ektron 8.6 工作

我正在尝试在我的 ektron 网站的 EkException 中使用辅助函数。
我尝试使用以下代码:


 Exception ex=new Exception("Test exception");
EkException.LogException(ex,System.Diagnostics.EventLogEntryType.Information);


LogEventEntry entry=new LogEventEntry();
entry.EventName="Test event";
entry.Timestamp=DateTime.Now;
entry.UserID=22;
entry.VisitorID="Test";
EkException.AddEventEntry(entry);

EkException.WriteToEventLog("Myapp",System.Diagnostics.EventLogEntryType.Information);

我尝试以管理员权限执行上面的代码,它没有抛出任何错误。
但是事件查看器没有变化。

有人可以帮助解决这个问题吗?

最佳答案

你想使用的类: Ektron.Cms.Instrumentation;

Log.WriteMessage(“我的消息”, LogLevel.Verbose);

请记住,您必须在 web.config 中打开 LogLevel。

Web.config,将 LogLevel 更新为“4”。
Instrumentation.config,将“Trace”添加到“Verbose”

 <add switchValue="All" name="Verbose">
<listeners>
<add name="Event Log" />
<add name="Trace" />
</listeners>

您也可以使用以下内容,但回顾一下您最有可能没有看到任何事件的原因是因为日志级别
    Ektron.Cms.Instrumentation.Log.WriteError("error");
Ektron.Cms.Instrumentation.Log.WriteWarning("warning");
Ektron.Cms.Instrumentation.Log.WriteInfo("info");

关于ektron - Ektron 中的 EkException 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15632798/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com