ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Autorotate json logs for portal containers


Article ID: 194362


Updated On:


CA API Developer Portal


Some of the containers are producing very large json.log file after the portal has been running without a reboot for a 60+ days.  Looking through the docker documentation, it seems adding the following to the /etc/docker/daemon.json file could offer a solution.   Can this be added to the file without affecting portal behavior / stability:

  "log-driver": "json-file",
  "log-opts": {
    "max-size": "300M", 
    "max-file": "3"


Release : 4.5

Component : API PORTAL


The following process applies to all newly created containers after restart.
You can edit the daemon configuration file. Please create the file if it doesn't exist.

1. vi /etc/docker/daemon.json
2. Add the following lines to file:
"log-driver": "json-file",
"log-opts": {
"max-size": "30m",
"max-file": "3"


[[email protected] ~]# docker ps | grep abde
abde8df95928 "/opt/" 3 hours ago Up 3 hours (healthy) portal_historical.1.mrhjg1096pi2lvkv1301v9u0j
[[email protected] ~]#


Logs for druid rotated twice

[[email protected] abde8df959287870e6dff542e202ce60bff03f17d9984f01a63c1f74e82279b7]# pwd
[[email protected] abde8df959287870e6dff542e202ce60bff03f17d9984f01a63c1f74e82279b7]# ls -la
total 62668
drwx------. 4 root root 4096 Jul 2 19:00 .
drwx------. 21 root root 4096 Jul 2 15:57 ..
-rw-r-----. 1 root root 3477935 Jul 2 19:00 abde8df959287870e6dff542e202ce60bff03f17d9984f01a63c1f74e82279b7-json.log
-rw-r-----. 1 root root 30000028 Jul 2 18:58 abde8df959287870e6dff542e202ce60bff03f17d9984f01a63c1f74e82279b7-json.log.1
-rw-r-----. 1 root root 30000163 Jul 2 18:37 abde8df959287870e6dff542e202ce60bff03f17d9984f01a63c1f74e82279b7-json.log.2