How can I prevent Mendix local log files from continuously filling up my disk space?

0
Hi everyone,I'm facing an issue with Mendix local log files consuming a large amount of disk space during development.The logs are continuously being generated in the following folder:C:\Users\Myprofile\AppData\Local\Mendix\logMendix keeps creating .txt log files, and the folder grows very quickly. I currently have to manually delete these log files every 2 hours because my disk starts filling up.I would like to know:Is there any setting in Mendix Studio Pro to limit or disable these local log files?Can the log retention period or maximum log file size be configured?Is it safe to delete these log files while Mendix is running?Has anyone experienced the same issue, and what is the recommended solution?I'm using Mendix Studio Pro 11.4.0 on Windows.Any suggestions or best practices would be appreciated. Thank you!
asked
2 answers
0

Hi Karthick,

As Eline mentioned, the issue is fixed in 11.12.2. Now Mendix automatically deletes log files older than 7 days. Unfortunatlly it is not there in below versions.

As of today there is no machanism implemented to set if to write log or not, or to change the retention period of logs.


You can do the following;


  1. Set the log level to show only warnig, error and critical in Run -> Default Log Level -> Warning.
  2. Spend time and delete it.
  3. Write a script and delete it automatically, this is how I manage my projects.


Below is the script I use;


$mendixLogPath = "$env:LOCALAPPDATA\Mendix\log"

Get-ChildItem -Path $mendixLogPath -Recurse -File -Filter "*.txt" |
Where-Object {
$_.Name -like "*log*" -and
$_.LastWriteTime -lt (Get-Date).AddDays(-7)
} |
Remove-Item -Force


Above will delete log files older than 7 days, you can modify it based on your requirements.


  1. Save the above as MendixLogCleanUp.ps1
  2. Open Task Scheduler
  3. Create Basic Task
  4. Add name, trigger and time
  5. Set action to start program
  6. set add argument and finish


Below is what needs to be added in arguments;


-ExecutionPolicy Bypass -File "filepath of the created MendixLogCleanUp.ps1"


Hope my answer helps. Reach me out for any queries.

answered
0

This happens to be something they fixed in 11.12.2, it seems:


We now delete the log files generated by Studio Pro that are older than 7 days.


It's not quite every few hours, but it's better than never clearing them, I suppose.

It might also be worth investigating why you're producting so many logs that it makes such a big difference in just 2 hours.


answered