Native Exception Handling in IronPDF

In recent versions of IronPDF, a native exception message in the logs will include a specific issue code: [Issue Code IRONPDF-NATIVE-EXCEPTION]. An example of such exception message is shown below:

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]

Possible Cause

IronPDF native exceptions typically arise from various issues related to the C++ code used in the IronPdf.Native.Chrome package, which serves as a dependency for IronPDF and involves the usage of the Chrome PDF rendering engine.

Solution

To receive assistance with issues related to native exceptions, please submit an engineering support request and provide full log files for further investigation.

Enable native logging by including the following code snippet in your project:

// Set the path for the log file. 
// This can be a directory name or a specific file path. Here, we set it to "Default.log".
IronPdf.Logging.Logger.LogFilePath = "Default.log";

// Enable logging for all modes to capture comprehensive details
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
// Set the path for the log file. 
// This can be a directory name or a specific file path. Here, we set it to "Default.log".
IronPdf.Logging.Logger.LogFilePath = "Default.log";

// Enable logging for all modes to capture comprehensive details
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
' Set the path for the log file. 
' This can be a directory name or a specific file path. Here, we set it to "Default.log".
IronPdf.Logging.Logger.LogFilePath = "Default.log"

' Enable logging for all modes to capture comprehensive details
IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All
$vbLabelText   $csharpLabel

Log files created by IronPDF are typically found in the /bin directory of your project where your DLLs are deployed, or you may set a custom IronPdf.Logging.Logger.LogFilePath to store the log files in a specific location. Relevant log files include:

  • Default.log: Contains information on deployment, threading, and the rendering process. It's useful for observing the process behavior and exceptions.
  • cef.log: Contains logs for the Chrome Embedded Framework process.

Please note
In older versions of IronPDF, log files may also include IronSoftwareEngine.log. Please submit all log files generated when requesting engineering support.

For cloud servers, log files may be located in specific directories. Refer to our guides for generating log files in Azure and AWS.

Chaknith Bin
Software Engineer
Chaknith works on IronXL and IronBarcode. He has deep expertise in C# and .NET, helping improve the software and support customers. His insights from user interactions contribute to better products, documentation, and overall experience.