I have program that programmatically changes stderr to write to a file, if
an error log has been defined in it's config file. That works fine, however
I have found that a runtime panic does not write to the error file. The
code I used follows:
errorLog, err := os.OpenFile(fqFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE,
// I have tried the following variations:
// os.Stderr = errorLog
stderrFD := int(errorLog.Fd())
err = syscall.Dup2(2, stderrFD)
I have reviewed the documentation and tried searching on "golang panic" and
other terms, but have not found any useful information. Any help would be
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/groups/opt_out.