or possibly use jdk1.4 and use the logging api in that.
chanoch
----- Original Message -----
From: "ElSayed, Kareem N" <kareem.elsayed@e...>
To: "Professional Java" <pro_java@p...>
Sent: Sunday, August 18, 2002 9:35 AM
Subject: [pro_java] Re: How to write a struct into a file by appendin g
method?
> it seems that you want to do some logging, why don't you have a look at
> log4j from the Jakarta project
>
> -----Original Message-----
> From: BS, Park [mailto:stone75@i...]
> Sent: Saturday, August 17, 2002 8:17 AM
> To: Professional Java
> Subject: [pro_java] Re: How to write a struct into a file by appending
> method?
>
>
> That's right :
>
> FileOutputStream fos = new FileOutputStream("error.txt", true);
>
> the second parameter means whether append or not.
>
> and to write e.printStackTrace()
>
> e.printStackTrace(fos);
>
> and to write error message, use follow method :
>
> e.getMessage();
>
>
> > I have a file error.txt,I want to append message into the file tail.I
> may get error.txt as OutputStream,like that:
>
> OutputStream is = this.getClass().getResourceAsStream("error.txt");
>
> I have a struct,it concludes:
> 1) Exception e
> 2) String errMsg
> 3) Date
>
> I want to write e.printStackTrace(),errMsg and new Date() into this file
> by adopting append method.How to realize it?
> Any idea will be appreciated!
> Thanks in advance!!!
> Edward
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.320 / Virus Database: 179 - Release Date: 1/30/2002
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.320 / Virus Database: 179 - Release Date: 1/30/2002
>
>