Set Up Log Rolling - NGINX Agent
Log rolling is a logging strategy that limits the size of the output log file. Once the log is full further logging acts as a queue. When the agent logs new lines it will remove old lines.
Enable Log Rolling
The NGINX agent does not use log rolling by default. To enable log rolling, do the following:
- Run the following
1chmod u+rwx /etc/nginx/logs2chown nginx /etc/nginx/logs
- Set the log_destination config file property to
The log file size limit can be configured with the
For more information, see Log Rolling.
To enable log rolling in NGINX, you must verify permissions on the configured log directory. The Linux user that your application server runs as should be able to read and write to this directory.
If you are using the Ubuntu or Debian installs of NGINX, the user will be named
www-data. Additionally, if you are using a custom configuration, this name may be customized as well.