Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Write Severe Error to log file

HAMISH
Beginner
903 Views
Is there a way to write a severe error to a log file instead of just the prompt window?
It would also be very nice to have the traceback information.

Basicallly I want the following info written to a file for all severe errors.
"forrtl: severe (164): Program Exception - integer divide by zero
Image PC Routine Line Source
ADsd1.exe 0271C753 _ADsd1 34 ADsd1.f90
ADsd1.exe 00EA7DB9 _MAIN__ 35 ADsd1.f90
ADsd1.exe 02AD31C3 Unknown Unknown Unknown
ADsd1.exe 02A757B9 Unknown Unknown Unknown
ADsd1.exe 02A7567F Unknown Unknown Unknown
kernel32.dll 74E0339A Unknown Unknown Unknown
ntdll.dll 77069EF2 Unknown Unknown Unknown
ntdll.dll 77069EC5 Unknown Unknown Unknown"

Thanks
0 Kudos
3 Replies
Steven_L_Intel1
Employee
903 Views
You can define the environment variable FOR_DIAGNOSTIC_LOG_FILE to be the path to a file where you want diagnostics written, including traceback.
0 Kudos
HAMISH
Beginner
903 Views
Thanks for the quick feedback. I added the environmental variable, but that still doesn't create the file I specified. I have hardcoded a division by zero error and am running it from the dos shell. It is printing the message to the shell.
is anything needed in the code? or at the time of compiling?
0 Kudos
HAMISH
Beginner
903 Views
I set the envionmental value with "" around it, and that seemed to be the issue. Without the quotes it is working great. Thank you
0 Kudos
Reply