Meta4 log files too big!!!

 

hi guys

i am testing some EAs on meta, and i came home from work, and i saw my harddrive almost full, then i saw that the log file in meta is taking alot of space, is there a way to disable it or is there a script designed to delete it???

cuz i was running 4 meta platforms, and then my harddrive got full and the EA stopped working

any ideas on how to resolve this??

thanks

 
connecting4less:
hi guys

i am testing some EAs on meta, and i came home from work, and i saw my harddrive almost full, then i saw that the log file in meta is taking alot of space, is there a way to disable it or is there a script designed to delete it???

cuz i was running 4 meta platforms, and then my harddrive got full and the EA stopped working

any ideas on how to resolve this??

thanks

the best solution is upgrading your hard disk capacity or u keep delete old log files inside the folder

 
Create a script to delete MT4 / MT5 log files(builds 670 and 965 respectively current)

See here # post 5

 

In my environment, the debug logs of applications under development create huge log files, so I am using a purging script as well, if anyone is interested.

Here is the main code snippet:

#include

#include

#property show_inputs

input bool applogs = true; // Delete application logs

input bool expertlogs = true; // Delete expert logs

input bool debuglogs = true; // Delete debug logs

input bool tmpfiles = true; // Delete *.tmp in files

void main() {

manager.add(new DeleteLogs());

}

class DeleteLogs : public MT4Script {

public:

DeleteLogs() {}

void onStart() {

if (expertlogs) deleteFolderContent("MQL4\\logs", "*.log");

if (expertlogs) deleteFolderContent("tester\\logs", "*.log");

if (applogs) deleteFolderContent("logs", "*.log");

if (debuglogs) deleteFolderContent("MQL4\\files\\LOGS", "*.log");

if (debuglogs) deleteFolderContent("tester\\files\\LOGS", "*.log");

if (tmpfiles) deleteFolderContent("MQL4\\files", "*.tmp");

if (tmpfiles) deleteFolderContent("tester\\files", "*.tmp");

}

void deleteFolderContent(const string folder, const string wildcard="*") {

MT4String searchPattern("\\\\?\\");

searchPattern + TerminalInfoString(TERMINAL_DATA_PATH) + "\\" + folder + "\\" + wildcard;

WIN32_FIND_DATA foundFileData;

string searchString = searchPattern.toString();

int searchHandle = FindFirstFileW(searchString, foundFileData);

bool found = (searchHandle != INVALID_HANDLE_VALUE);

while(found) {

string name = ShortArrayToString(foundFileData.cFileName);

if ((foundFileData.dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0

&& (foundFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0

) {

MT4String file("\\\\?\\");

string filename = (file + TerminalInfoString(TERMINAL_DATA_PATH) + "\\" + folder + "\\" + name).toString();

Print("Deleting " + folder + "\\" + name);

DeleteFileW(filename);

}

found = FindNextFileW(searchHandle, foundFileData);

}

}

};

deletelogs.ex4

Files:
deletelogs.ex4  17 kb
Reason: