Automate Log Downloads
Learn how to automate your log downloads.
This section provides information on how to automate the process of accessing and maintaining your logs with a script.
Create a Script
-
Run the command below to create and access a new local directory:
-
Choose your preferred method from the Rsync version and SFTP version tabs at the end of this section, and then click the Download button to download the script.
-
Move the downloaded script to the
site-logsdirectory you created. -
Use your preferred text editor to edit
collect-logs.shand replace thexxxxxxxwith the appropriate site UUID and environment.- Please note that the resulting log file might be large.
The script provides several modifiable variables described in the comments. Read the comments in the scripts carefully to ensure that you modify variables correctly.
Parameterize the Script
You can run the script with parameters for reusability.
- Edit the 'collect-logs-rsync.sh' (you can choose to disable the AGGREGATE_NGINX):
- Modify the script access level:
- Run the script with parameters. For example:
Collect Logs
You can collect your logs after you create your script.
- Navigate to the
site-logsdirectory and then execute the script below to download the logs.
-
Open the
site-logsdirectory to access the logs.- More than one directory is generated for sites that use multiple application containers.