HelloMum / COMP47360-Smart-Tourist-Guide

GNU General Public License v2.0
2 stars 0 forks source link

Backend Logging Unnecessary Information and Filling Disk Space #108

Closed HelloMum closed 3 months ago

HelloMum commented 3 months ago

image Issue: The backend application is currently logging excessive and unnecessary information to the output, which is rapidly consuming disk space on the server. (The disk was filled by the logfile (more than 30 gbs))

Expected Behavior: Logging should be limited to essential information required for monitoring and debugging purposes.

Actual Behavior: The backend is generating an unusually large amount of log data, leading to rapid disk space consumption.

Proposed Solution:

For now backend is disabled on deployment.

HelloMum commented 3 months ago

Server configuration applied on server to limit maximum logging size in the global settings:

/etc/docker/daemon.json

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",   // Maximum size of each log file (10 megabytes)
    "max-file": "3"      // Maximum number of log files to retain (3)
  }
HelloMum commented 3 months ago

Added a quick fix on the docker composer while the other changes are made: logging: driver: "json-file" options: max-size: "10m" max-file: "3"

HelloMum commented 3 months ago

Fixed on #111