JavaService append mode instead of truncating log file

U

uy_do

Hi,
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
*errFile)
{
.......
jobject fileOutputStream = env->NewObject(fileOutputStreamClass,
fileOutputStreamConstructor, filePathString,true);
......
}
 
H

Harish Madhavan

1. boolean in java maps to jboolean in C
2. Check whether fileOutputStreamConstructor is FileOutputStream(File file,
boolean append) or FileOutputStream(File file)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top