Download MetaTrader 5

Where are the log files when using the new MQL4's Print() function?

To add comments, please log in or register
Do you need a programmer? Freelance service will find the developer you need!
Jordi Bassaganas
3527
Jordi Bassaganas 2014.02.10 09:56 

Hi there,

MQL5's Finding Errors and Logging says: "all messages are written without notifications into the "Experts" tab and into the "Terminal_dir\MQL5\Logs\data.txt" file".

Everything's ok in MQL5. However, when using the Print function in my new MQL4 fresh copy, I don't get any log file...

Any tip is welcome, thank you in advance.

Simon Gniadkowski
Moderator
17999
Simon Gniadkowski 2014.02.10 09:59  
laplacianlab:

Hi there,

MQL5's Finding Errors and Logging says: "all messages are written without notifications into the "Experts" tab and into the "Terminal_dir\MQL5\Logs\data.txt" file".

Everything's ok in MQL5. However, when using the Print function in my new MQL4 fresh copy, I don't get any log file...

Any tip is welcome, thank you in advance.

Look in the MQL4\Logs folder . . .
Jordi Bassaganas
3527
Jordi Bassaganas 2014.02.10 10:03  
RaptorUK:
Look in the MQL4\Logs folder . . .


Thanks a lot, I looked there already, of course, but there is no file.

I'm just using the Print function in a fresh MQL4 download.
Everything's ok but the log file seems to be missing.
Simon Gniadkowski
Moderator
17999
Simon Gniadkowski 2014.02.10 10:05  
laplacianlab:

Thanks a lot, I looked there already, of course, but there is no file.

I'm just using the Print function in a fresh MQL4 download.
Everything's ok but the log file seems to be missing.
OK, either right click in the Experts tab window and click Open . . . or . . click File > Open Data Folder then from there open the Logs folder.
gchrmt4
356
gchrmt4 2014.02.10 10:11  
RaptorUK:
OK, either right click in the Experts tab window and click Open . . . or . . click File > Open Data Folder then from there open the Logs folder.

My own experience is that the log file in MQL4\logs is not necessarily written immediately. It seems that you can have output visible on screen which is not yet committed to disk. For example, I've just done the following test: start MT4 v604; run a script which does Print(); nothing in MQL4\logs; shut down MT4; log is written on shutdown.

I haven't investigated what the delay or write-threshold is between doing Print() and having something appear on disk. But it no longer seems to be immediate - which I can't say that I like. If MT4 terminates abnormally - e.g. terminated using Task Manager - then it seems that some Print() output can get lost.

Simon Gniadkowski
Moderator
17999
Simon Gniadkowski 2014.02.10 10:15  
gchrmt4:

My own experience is that the log file in MQL4\logs is not necessarily written immediately. It seems that you can have output visible on screen which is not yet committed to disk. For example, I've just done the following test: start MT4 v604; run a script which does Print(); nothing in MQL4\logs; shut down MT4; log is written on shutdown.

I haven't investigated what the delay or write-threshold is between doing Print() and having something appear on disk. But it no longer seems to be immediate - which I can't say that I like.

This was also the case with the "old" MT4, some users reported that output to the file was delayed, it was also reported that opening from a right click the Experts tab pane would flush the file.
gchrmt4
356
gchrmt4 2014.02.10 10:17  
RaptorUK:
This was also the case with the "old" MT4, some users reported that output to the file was delayed, it was also reported that opening from a right click the Experts tab pane would flush the file.
... if you say so. I've never seen that myself, and I can't replicate it in v509.
Jordi Bassaganas
3527
Jordi Bassaganas 2014.02.10 10:18  

Sorry for opening this thread..

I was not looking well. I have many MQL instances.

On the one hand, I can access my log file by browsing my file system and going to Roaming/MetaQuotes/Terminal/mql_instance/tester/logs/

On the other hand, as you say now, I can also access the log file by right-clicking MQL4's Navigator Log folder.

Everything's ok, thks

Simon Gniadkowski
Moderator
17999
Simon Gniadkowski 2014.02.10 10:19  
laplacianlab:


Everything's ok, thks

Glad to hear it, you are most welcome
Jordi Bassaganas
3527
Jordi Bassaganas 2014.02.10 10:33  
RaptorUK:
This was also the case with the "old" MT4, some users reported that output to the file was delayed, it was also reported that opening from a right click the Experts tab pane would flush the file.


Yes, it seems to be a delay or something.. I don't know.

Anyway, you can access the log file almost instantaneously and directly from the filesystem -> Roaming/MetaQuotes/Terminal/mql_instance/tester/logs/

gchrmt4
356
gchrmt4 2014.02.10 10:38  
gchrmt4:
... if you say so. I've never seen that myself, and I can't replicate it in v509.
(I have seen this in backtesting but, until the most recent post from laplacianlab, this topic seemed to be about live results in MQL4\Logs, not backtesting results in tester\logs.)
12
To add comments, please log in or register