MQL4 upgrade to 6xxx problem with printing to log file

Back to topics list To post a new topic, please log in or register
avatar
1
WalterMK 2014.04.28 10:29
 

Hi

My EA was logging into log file using Print() function without any problem. After the upgrade the text is logged but is not visible until I remove EA and close the terminal! Look like problem with buffer flushing?

Please help

WalterMK

avatar
22
fonx 2015.07.13 21:52 #
 

Hi did you find any solution for this problem. I'm stuck in the same situation and it is just know after reading your post that I managed to get the text into the file after stopping the EAs and closing the terminal. For instance if I just close the terminal it doesn't seem to flush the text into the log file.

I haven't tried to wait till next day to see if it flushes into the previous day file. I'll try it tonight, but I need the logs as soon as possible. I hope someone can help.

I use Oanda MT4 Version 4.00 Build 842

avatar
22
fonx 2015.07.13 22:28 #
 

As I've found in other threads (i.e. https://forum.mql4.com/28877) apparently MT4 only flushes when it wants. The thread is from 2010 but seems that MT4 continues on that line.

I don't know the reason, honestly :P 

avatar
13009
WHRoeder 2015.07.14 04:02 #
 
If it flushed every byte it would be a tremendous burden on disk, CPU, and RAM. Every Operating System flushes periodically. If you want otherwise use a file and flush it yourself.
avatar
1110
Ovo 2015.07.14 07:49 #
 

The problem is that MT4 file flush seems to behave differently than the operating system flush, it apparently has an additional buffer layer in the application. When using the operating system, if you try to access the unflushed file for reading, you actually get to the file buffer, and the accessed file data is complete. On the other hand, with the MT4 the file data is always incomplete without flush, and sometimes it misses a few last bytes even with the flush.

Back to topics list  

To add comments, please log in or register