DP4 has several kinds of diagnostic messages and output. DP4 System Error and Fail Messages are normally displayed on the screen for the user to act upon. They are also written to SYSLOG.PRN file, and, on Windows NT family operating systems, to the Application Event Log. If you have a problem with DP4 that is proving difficult to isolate you may want to enable the DP4 Error logging program which can display additional diagnostics about many aspects of DP4 operation.
The error log program is loaded if you specify -load_errlog on the command line for the DP4 loader (e.g. srvw32.exe on Windows, or dbdaemon on Linux), or if you put load_errlog=1 in the [system] section of the DP4 configuration file. The diagnostics are normally written to the file debug.out in the current working directory.
There are two methods of getting the diagnostics to also display on the screen:
If you specify -debug_echo on the command line to the DP4 loader (or put debug_echo=1 in the [errlog] section), the error logger will display a scrollable on screen window containing the most recent diagnostic messages (on Unix output is just displayed on the console/terminal where dbdaemon was started). (If DP4 is run as a service it must be set to interact with the desktop.)
As of release 4.622, and on Windows platforms only you can show the DP4 error log window at any time using the "View log file" command in the popup menu for the DP4 service. You can also clear the contents of the Window by pressing the Delete key, or copy/cut the contents of the visible part of the window with Ctrl+C/Ctrl+X, or the entire window with Ctrl+A.
For Windows only, If you specify debug_console=1 in the [win32] section of the DP4 configuration, or -debug_console on the command line to a program the error logger is bypassed. Instead each DP4 program will create a console window to display diagnostic messages. This may be useful if you want to clearly separate each program's diagnostics from that of other programs.
Most DP4 diagnostics are written using a slightly modified printf() function, and are in fact written to stdout - the DP4 loader ensures that stdout is a pipe into the errlog program for programs run as part of the DP4 system. On Unix and Linux this is the only output errlog catches. On Windows, for programs not run by the loader the DP4 printf() will test the stdout value. For most Windows programs it is invalid and diagnostics are written to the ERRLOG program. If stdout is valid (for example because you started the program from a DOS prompt and supplied an output redirection), then the output will be sent there instead. This may cause a problem with some third party products, for example if you want diagnostics when using DP4 ODBC drivers with Microsoft Access, because the product supplies a stdout, but does not display the information anywhere. You can force a program to output to errlog by creating a [progname] section for it in the DP4 configuration file and adding an ignore_stdout=1 entry. Unfortunately this option cannot usually be specified on the command line. For example, in the case of Microsoft Access the appropriate [progname] is [msaccess]. You can get your own C programs to output printf() to the DP4 error log by linking with the appropriate version of the DP4 syslib library before the regular C library. You can also get them to report version information, either by using the DP4 version stamping utility (bizarrely named kentcurs), to add version information or by providing a function named vs_verstring() somewhere in your code. This function is prototyped in the verstamp.h file, and should return a pointer to a null terminated string containing version information.
If you want to diagnose problems with starting or stopping the DP4 system you may well want to specify the ignore_shutdown=1 option in the [errlog] section, (or -ignore_shutdown on the command line to the DP4 loader).
The output file for DP4 diagnostics is normally only allowed to grow to a certain size. When it reaches that size the file is closed and a new file started. The exact details of when this happens and what happens to the old file depend on various other entries in the [errlog] section.
Just turning on errlog does not enable all the DP4 diagnostics (though most error diagnostics are turned on in the supplied DP4 configuration file). For most programs diagnostics are turned on or off by the various entries in the [debug] section. You should always remember to turn off the [debug] section entries once a problem is solved, otherwise DP4 will waste time continuing to format invisible diagnostics! For some programs, notably the DP4 network programs, diagnostics are turned on with a −debug or −debug_error command tail.