Aspera

Aspera

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Clearing Faspex5 Docker Container Logs

By RAJAN N C KRISHNAN posted Mon February 12, 2024 04:39 AM

  

There may be some situations when one of the Faspex5 docker container logs get filled. This article shows how to clear the Faspex5 container logs. 

1. Check the docker host machine storage.

df -h

Check if any partition is fully utilized. In the screenshot below, we can see that the / partition is 100% used. 

2.  Get which docker log file is occupying the most space. 

sudo sh -c "du -ch /var/lib/docker/containers/*/*-json.log"

From the screenshot, you can see that the last log occupies most of the disk space. 
3. Next step to find out which container this log file belongs to. You need to check the containers one-by-one and find the one that has a matching log file. 
sudo docker inspect --format='{{.LogPath}}' COMPONENT_NAME
Example:
sudo docker inspect --format='{{.LogPath}}' faspex-db
Check the output that matches the log file that occupies the largest space (from step 2). 
Fro the screenshot, looks like the faspex-db owns the log file that occupies most of the space. 
4. Now that we know which components occupies the most space, lets clear the log for that container. 
sudo sh -c 'echo "" > $(docker inspect --format="{{.LogPath}}" faspex-db)'
5. The log file should now be cleared. Restart faspex5. 

faspexctl stop 

Make sure all components are stopped. If there are any that did not stop, you can restart docker to stop those. 

systemctl restart docker

Then, start Faspex.

faspexctl start

Check the device and you should notice that the disk space has been cleared. 

Note that we are simply clearing the logs. If you notice that the logs are getting filled too frequently, you may have to check further on why that is happening. 

0 comments
8 views

Permalink