Guys:
How can I rename the default filename for the error log (Error.log) during program execution ?
Thank you.
Guys:
How can I rename the default filename for the error log (Error.log) during program execution ?
Thank you.
Here is what I do for error and trace log files.
cLogFile := gete('username')
Set( _SET_ERRORLOG, cLogFile+'_diwin.err' )
Set( _SET_TRACEFILE, cLogFile+'_diwin.log' )
You can also do the following for the error log file.
Set errorlog to filename
#include "fivewin.ch"
FUNCTION MAIN()
SET ERRORLOG TO myerrorfile.log
USE nothing
RETURN NILFW provides for setting path to write error.log file, but does not provide for a different name for error.log file.
We may set a different folder where the error.log is written by calling function SetErrorPath( cNewPath ) --> cOldPath.
cNewPath should end with "\".
Error.log file will be written in cNewPath + "Error.log"
I use xHarbour commercial so it may support the error log filename.
This is from the documentation.
Syntax
SET ERRORLOG TO <cLogFile> [ADDITIVE]
Arguments
<cLogFile>
This is the name of the file that stores information about runtime errors. The default file is named "Error.log"
ADDITIVE
If this option is specified, new error information is appended to the log file. Otherwise, <cLogFile> is overwritten when a new error occurs. Description
The SET ERRORLOG command is used in customized error handling routines where error information about runtime errors is written to a user-defined file. By default, runtime error information is stored in the Error.log file.
Hunter,
The filename is hardcoded in errsysw.prg. You can just change it there and compile and add the OBJ to your link script. I have done this in the past. Actually, I modified it to create a new sequential filename for each new error so I could review all the errors that an app had generated. You could even set it up to email the error file to you.
We might suggest to Antonio that it would be nice to have a SetErrorFilename() function similar to the existing SetErrorPath() function. Then we wouldn't have to modify the source. This wouldn't, however, allow you to have incremental filenames. This would be another nice feature that could be turned on with just a flag.
Regards,
James
We might suggest to Antonio that it would be nice to have a SetErrorFilename() function similar to the existing SetErrorPath() function.
![]()
Implemented for next FWH build ![]()
You could even set it up to email the error file to you.
Antonio & Rao:
Great discussion. Good to know that it will be implemented. Thank you to all you guys who posted on this thread.