[QFJ-318] FileLog for Messages Sometimes Omits Endline Between Messages Created: 27/Jun/08 Updated: 29/Sep/16 Resolved: 01/Jul/08 |
|
Status: | Closed |
Project: | QuickFIX/J |
Component/s: | Engine |
Affects Version/s: | 1.3.1 |
Fix Version/s: | 1.3.2 |
Type: | Bug | Priority: | Default |
Reporter: | Robert Reyes | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Environment: |
Red Hat SE 5 Linux |
Issue Links: |
|
Description |
The .messages log file does not show the endline between two distinct FIX messages. You'll notice that the field delimiter does show up after tag 10 in the first message, but then the second message is appended onto it without a new line being started. 20080626-15:42:19.969: 8=FIX.4.2☺9=208☺35=G☺34=429600☺49=SENDER☺52=20080626-15:42:19.969☺56=TARGET☺1 |
Comments |
Comment by Robert Reyes [ 27/Jun/08 ] |
It turns out that this is due to FileLog.java not synchronizing on the writeMessage method. After the two messages that printed together were finished, I saw an empty line print out. |
Comment by Jörg Thönnes [ 28/Jun/08 ] |
Ideally, file append mode and atomic writes should be used here. In UNIX, this would be the O_APPEND mode Using synchronized writeMessage() is the second best alternative, IMHO. |
Comment by Steve Bate [ 01/Jul/08 ] |
The tradeoff is between creating more temporary objects to prebuild the complete log text before calling write() or to synchronize the writeMessage method. It seems to me that the synchronization might be less overall impact on performance than creating an extra temporary object for log write. |