# Logging Configuration The CloudStack log files grow unbounded by default. If you don't want to manage them yourself, you can use these steps to limit the amount of disk space they use. ## CloudStack Logs CloudStack uses log4j XML files to hold the logging configuration. There are separate config files for the management server and the agent. (The agent is found on the VM host machines.) Feel free to adjust the policy values shown below as needed. ### Management Server Edit `/etc/cloudstack/management/log4j.xml`. Find the `rollingPolicy` that refers to `management-server.log`, and replace it with this: ```xml ``` Next find the rolling policy that refers to `apilog.log`, and replace it with this: ```xml ``` To make the changes take effect, run `systemctl restart cloudstack-management`. ### Agent Edit `/etc/cloudstack/agent/log4j-cloud.xml`. Find the `rollingPolicy` that refers to `agent.log`, and replace it with this: ```xml ``` To make the change take effect, run `systemctl restart cloudstack-agent`. ## Tomcat Logs CloudStack uses Apache Tomcat, and it has its own access log. I've never seen it get very big, so you might not need to worry about it. If you want to truncate it daily, add a cron job like this: ```bash cat << EOF > /etc/cron.daily/truncate_cloudstack_tomcat_log #!/bin/bash truncate --size 0 /var/log/cloudstack/management/access.log EOF chmod +x /etc/cron.daily/truncate_cloudstack_tomcat_log ```