The code listed below uses
Java's (jdk 1.4) logging utility. A new log file is created for each day and messages are appended to the file.
In a single
thread the code works as per the above defined requirement. However in a multithreaded
test case, the program does not create a single file. Messages from mutiple threads are written to multiple files. The behaviour is as listed.
Say there are 5 messages from five threads.
The logger creates five log files and five lock files. All five messages are posted to the first log. Four messages are posted to the second file. Three to the next and so on. The last file contains one message.
Any help in resolving the issue is appreciated.
[ April 28, 2003: Message edited by: Jim Yingst ]