"Prevent cBot crashes due to full log.txt – add auto-rotation or logging API control"

Created at 02 May 2025, 10:21
DA

davidrob

Joined 15.08.2024

"Prevent cBot crashes due to full log.txt – add auto-rotation or logging API control"
02 May 2025, 10:21


Ok, I have been digging into this with CodePilot, and came across this limitation. I used Print() stmt's in my bot for extensive debugging and tracing new code for accuracy. I filled the log file (log.txt) up very quickly, and found out that when log.txt fills up…. the Bot stops. So I manually created a new log file, and then the Bot would simply not restart at all. Luckily exiting CTrader, and restarting fixed the issue (I may have deleted the file altogether first).  Ok, so here's the future scenario: your bot is running in the cloud, even though you created a separate external logging system to minimise(more like eliminate) log.txt entries, after several weeks of trades, the log fills up and your super stable lovable and dependable Bot just dies like a rat. And doesn't tell you first. You finally decide to check your bot, and find it it has been dead for days.

Guys and Gals, I know you are busy doing awesome things, but this is just not on.  For goodness sake, please put in a Rotate function, where a new log is created when the old one gets too full.  According to CodePilot, I cannot read the log.txt file to do it myself.  Arghhhhh….. Please fix  it.

 

 


@davidrob
Replies

firemyst
03 May 2025, 06:25

Duplicate of /forum/ctrader-support/46987/


@firemyst