JavaService append mode instead of truncating log file

From: uy_do (
Date: 12/03/03

Date: Wed, 3 Dec 2003 15:33:25 -0600

I don't know if this is the right place or not, but after trying google &
asking Mutiplan guys without any results, I decide to post it here to see if
anyone ever experienced the same problem.
I'm developing a java application that is deployed as a service on windows
2000, and I use JavaService as the tool. It works fine until I find out that
whenever I restart the service, the log file/error file is truncated instead
of appending to it and the old information was wiped out. I tried the class
FileOutputStream(File,append) , but the files(both the log & error files)
were still truncated.
The code I use is retyped here as a reference:
static bool redirectSystemErr(HANDLE hEventSource, JNIEnv *env, char
jobject fileOutputStream = env->NewObject(fileOutputStreamClass,
fileOutputStreamConstructor, filePathString,true);
Is there any way to keep the log or error file and append to it instead
truncating it when you restart the service?
Any help is appreciate.