IronPDF本机异常

This article was translated from English: Does it need improvement?
Translated
View the article in English

在最近版本的IronPDF中,日志中的本机异常消息将包含一个特定的问题代码:**[错误代码 IRONPDF-NATIVE-EXCEPTION]以下是此类异常消息的一个示例:

IronPdf.Exceptions.IronPdfNativeException: Error while generating PDF from HTML: 'Error while rendering pdf from html for job group 0: 'Error during dev tools execution: {"method":"Inspector.targetCrashed","params":{}}''.
2024-01-25 08:12:11,960 INFO  [Thread-3] [, , , , , , , , ] c.i.i.i.s.Access: [IronPdfEngine]To learn how to solve this issue please read https://ironpdf.com/troubleshooting/ironpdf-native-exception [Issue Code IRONPDF-NATIVE-EXCEPTION]

可可能的原因

IronPDF 原生异常通常源自与 IronPdf.Native.Chrome 包中使用的 C++ 代码相关的各种问题,该包作为 IronPDF 的依赖项,涉及使用 Chrome PDF 渲染引擎。

解决方案

要获得有关本地异常问题的帮助,请提交一个 工程支持 请求并提供完整的日志文件以进行进一步调查。

通过在您的项目中包含以下代码片段来启用本机日志记录:

IronPdf.Logging.Logger.LogFilePath = "Default.log"; //May be set to a directory name or full file

IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
IronPdf.Logging.Logger.LogFilePath = "Default.log"; //May be set to a directory name or full file

IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
IronPdf.Logging.Logger.LogFilePath = "Default.log" 'May be set to a directory name or full file

IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All
VB   C#

IronPDF创建的日志文件通常位于项目中部署DLL的/bin目录,或者您可以设置自定义的 IronPdf.Logging.Logger.LogFilePath 以将日志文件存储在特定位置。相关日志文件包括:

  • Default.log (部署、线程和渲染过程。用于观察过程行为和异常。)
  • cef.log (Chrome嵌入式框架进程)

请注意
在旧版本的IronPDF中,创建的日志文件可能还包括IronSoftwareEngine.logIronSoftwareEngine.log。在请求工程支持时,请提交生成的所有日志文件。

对于云服务器,日志文件可能位于特定目录中。请参考我们的指南以生成日志文件。 AzureAWS.