8

由于 log4net 随 VS2010 的 CR 一起提供,因此有理由记录内容。如何将 CR 日志级别设置为调试,以便弄清楚我的报告发生了什么?

我应该澄清一下,我的项目中已经有 log4net 了,我只是没有从 CrystalReports 中看到任何东西。

4

1 回答 1

1

此链接包含有关如何启用额外日志记录的详细信息:

https://apps.support.sap.com/sap/support/knowledge/public/en/0001470978

摘抄:

  1. 使用记事本创建两个名为 logging-on.reg 和 logging-off.reg 的 .reg 文件。
  2. 将下面相应部分的文本复制到每个 .reg 文件中并保存。
  3. 将 .reg 文件复制到需要进行日志记录的系统。
  4. 双击 logging-on.reg 文件并将内容合并到注册表中。
  5. 重新启动您正在监视的 IIS、服务或 Windows 应用程序。注意:如果 Crystal 运行时文件已在内存中,则日志记录将不起作用。
  6. 运行应用程序直到出现故障或出现错误消息。
  7. 在临时目录中找到 .log 文件。
    • 视窗XP;C:\Documents and Settings\\本地设置\Temp
    • Windows Vista,7,服务器 2008;C:\Users\\AppData\Local\Temp
    • 运行 Visual Studio IDE 的 Windows Server 2008 会创建一个子文件夹 \2(在我的例子中),VS 将其用作临时文件夹。这是日志文件所在的位置
  8. 它们将根据应用程序命名。例如,如果您的应用程序名为 mySlowReport.exe - 日志文件将命名为:
    • mySlowReport.crpe.bkgrnd.log
    • mySlowReport.crpe.Diagnostics.log
    • mySlowReport.crpe.functions.log

用于 Visual Studio 2010 的水晶报表

注意 Crystal 为 Visual Studio 2010 创建的日志文件扩展名为 .GLF。

启用日志记录

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging]
[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.bkgrnd]
"Destinations"=dword:00000003
"Position"=dword:00000003
"LogErrorsOnly"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.diagnostics]
"Destinations"=dword:00000003
"Position"=dword:00000003
"LogErrorsOnly"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.functions]
"Destinations"=dword:00000003
"LogErrorsOnly"=dword:00000000
"Position"=dword:00000003
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.bkgrnd]
"Destinations"=dword:00000003
"Position"=dword:00000003
"LogErrorsOnly"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.diagnostics]
"Destinations"=dword:00000003
"Position"=dword:00000003
"LogErrorsOnly"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.functions]
"Destinations"=dword:00000003
"LogErrorsOnly"=dword:00000000
"Position"=dword:00000003

禁用日志记录

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging]
[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.bkgrnd]
"Destinations"=dword:00000000
"Position"=dword:00000000
"LogErrorsOnly"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.diagnostics]
"Destinations"=dword:00000000
"Position"=dword:00000000
"LogErrorsOnly"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.functions]
"Destinations"=dword:00000000
"LogErrorsOnly"=dword:00000000
"Position"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.bkgrnd]
"Destinations"=dword:00000000
"Position"=dword:00000000
"LogErrorsOnly"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.diagnostics]
"Destinations"=dword:00000000
"Position"=dword:00000000
"LogErrorsOnly"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Logging\crpe.functions]
"Destinations"=dword:00000000
"LogErrorsOnly"=dword:00000000
"Position"=dword:00000000
于 2016-06-14T21:46:34.577 回答