Logs generation getting stopped

0
Hello Community,   On our Private cloud, the application logs are not getting generated after every 5-7 days. We have to restart our application in order to start log generation.    Logged in to the server where our mendix container is running and found the container consumed only about 136 kb which is not more.   Also had a look on logrotate.conf and found the below details.   # rotate log files weeklyweekly # keep 4 weeks worth of backlogsrotate 4 # create new (empty) log files after rotating old onescreate # use date as a suffix of the rotated filedateext compress   Can you please suggest what else we can do to ensure the log generation never stops on our application?
asked
2 answers
0

Hi Avadhoot,

If your Mendix application logs stop generating after 5-7 days and only resume after restarting the application, the issue may be related to log rotation, container logging behavior, or system resource limits. One possible cause is that the application is writing logs to a file that gets rotated but does not automatically switch to the new log file. You can check this by running lsof | grep <your-log-file> to ensure the logs are still being written to the correct location. Additionally, modifying the logrotate.conf settings by adding copytruncate could help, as this allows the log file to be truncated in place while keeping the same file descriptor. Another factor to consider is disk space and inodes, which can be checked using df -h and df -i. If disk usage is high, logs may stop being written. Furthermore, if your Mendix container is configured to log to stdout or stderr, the logs might be stored in the Docker logging system instead of a file. Running docker logs <container_id> can help determine if logs are still being captured. If the issue is related to logging limits, check the Docker daemon settings (/etc/docker/daemon.json) and adjust parameters like max-size and max-file to allow more log retention. It is also worth enabling debug-level logs temporarily in Mendix to identify potential runtime issues that may be causing logs to stop unexpectedly. As a workaround, you can set up a cron job or monitoring script to check whether logs are being written and automatically restart the logging service or the Mendix application if necessary. If the problem persists, examining Mendix runtime logs, container logs, and system logs (dmesg or journalctl) might provide additional insights into the root cause.

 

If this does not help, you can refer to this doc, maybe this will help:

Logs | Mendix Documentation

 

Hope this helps!

answered
0

Hi Rishabh,

 

Thank you for sharing the details. Do you know if there is any way to set these configuration related to log rotation on Mendix runtime?  Because mendix does not allow us to modify the DaemonSets or ConfigMaps and we cannot really set these parameters directly on a node as the configuration will be lost whenever the node is replaced.

answered