Is this the first time you're accessing the log stuff? there's probably
already a log file created at the file COM1.log location and it's locked
for writing.

If you really want to find out what's going on, just debug the logging
code. Or change the name of the file to something else...

-----Original Message-----
From: Enrico Goosen [mailto:[EMAIL PROTECTED] 
Sent: 14 December 2005 03:22 PM
To: [email protected]
Subject: [CTJUG Forum] Re: java.util.logging.FileHandler


I added %u, and now it works:
FileHandler(System.getProperty("user.dir")+"\\logs\\"+key+"%u.log");

Very strange.

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
On
Behalf Of Brian Silberbauer
Sent: 14 December 2005 03:10 PM
To: [email protected]
Subject: [CTJUG Forum] Re: java.util.logging.FileHandler

Hi Enrico
Does "C:\Projects\Voicemail\logs" exist?
Brian
On 12/14/05, Enrico Goosen <[EMAIL PROTECTED]> wrote:>>>> Hi All,>>>>
Can
anyone give me a hand with java.util.logging please?>> My program spawns
Threads that communicate with modems on separate ports.>> I would like
to
create a Logger for each modem.>> I'm trying to create the log file in
my
logs directory straight off user.dir> like this:>> FileHandler fh = new>
FileHandler(System.getProperty("user.dir")+"\\logs\\"+key+".log");>>>>
But I
get this Exception when I run my program:>>>>
java.io.FileNotFoundException:> C:\Projects\Voicemail\logs\COM1.log
(Access
is denied)>>         at java.io.FileOutputStream.open(Native Method)>>
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)>>
at
java.io.FileOutputStream.<init>(FileOutputStream.java:102)>>         at>
java.util.logging.FileHandler.open(FileHandler.java:156)>>         at>
java.util.logging.FileHandler.rotate(FileHandler.java:535)>>         at>
java.util.logging.FileHandler.openFiles(FileHandler.java:423)>>
at
java.util.logging.FileHandler.<init>(FileHandler.java:237)>>         at
com.saicom.voicemail.App.<init>(App.java:113)>>         at
com.saicom.voicemail.App.main(App.java:146)>>>> Very annoying.>>>>
Enrico
Goosen>> Software Developer>> SAICOM TECHNOLOGY>> TEL:       +2721 555
0726>> FAX:     +2721 555 0821>> CEL:     +2783 305 5676>> EMAIL:
[EMAIL PROTECTED]>>

--Brian SilberbauerConsultant
+27 (0)83 566 2705skype: brian.silberbauer


Reply via email to