In order to facilitate troubleshooting, it is necessary to activate debug logging
Symptoms:
How to Enable debug logging on SaltStack
VMware Aria Automation Config 8.x +
SaltStack 3004.x +
Tanzu Salt 8.x+
Caution: Running Salt in debug mode may expose sensitive information, including authentication credentials and configuration details. It should only be used for troubleshooting purposes. Please exercise caution and ensure that debug mode is disabled once your issue is resolved to protect your system's security and confidentiality.
This is a quick tutorial on adjusting the logging level for Aria Config and Salt. Please see https://docs.saltproject.io/en/latest/ref/configuration/logging/index.html for the official documentation on logging in SaltProject.
To enable debug logging on SaltStack, we need to configure Salt's logging settings.
Debug logging provides detailed information about what Saltstack is doing, making it useful for troubleshooting issues and gaining insights into Salt's operations. Here are the steps to enable debug logging:
Enable Salt-Master Debug Logging
1. Edit the Salt Master Configuration.
On your Salt Master server, locate the Salt Master configuration file. Typically, this file is named "master" and is located in "/etc/salt/" on Linux systems.
Open the configuration file in a text editor with administrative privileges, such as "sudo" or "su" depending on your system's configuration.
2. Update the Logging Configuration
In the configuration file, find the section related to logging. It may look like this:
You can also configure the `log_level_logfile` if you want to specify a different log level for the log file.
3. Save and Close the Configuration File
4. Restart the Salt Master
After making the changes, you need to restart the Salt Master to apply the new logging configuration.
sudo systemctl restart salt-master
Verify that the Salt Master has restarted successfully.
5. View Debug Logs
Salt logs will now include debug information. You can view the logs in real-time using a command like `tail`:
sudo tail -f /var/log/salt/master
6. Disable Debug Logging
Once you've finished debugging or troubleshooting, remember to set the `log_level` back to its original value (e.g., `'info'` or `'warning'`) to reduce log verbosity.
7. Restart the Salt Master Again
After making any changes to the logging configuration, restart the Salt Master to apply the changes.
Enable Raas Debug Logging
1. Edit the Salt Raas Configuration.
On your SaltStack Raas server, locate the raas configuration file. Typically, this file is named "raas" and is located in "/etc/raas/raas".
Open the configuration file in a text editor with administrative privileges, such as "sudo" or "su" depending on your system's configuration.
2. Update the Logging Configuration
In the configuration file, find the section related to logging. It may look like this:
3. Save and Close the Configuration File
4. Restart the Raas service
After making the changes, you need to restart the Raas to apply the new logging configuration.
sudo systemctl restart raas
Verify that the raas have restarted successfully.
5. View Debug Logs
Salt logs will now include debug information. You can view the logs in real-time using a command like `tail`:
sudo tail -f /var/log/raas/raas
6. Disable Debug Logging
Once you've finished debugging or troubleshooting, remember to set the `log_level` back to its original value (e.g., `'info'` or `'warning'`) to reduce log verbosity.
7. Restart the raas again
Enable Salt-Minion Debug Logging
1. Edit the Salt Minion Configuration.
On your Salt Minion server, locate the Salt Minion configuration file. Typically, this file is named "minion" and is located in "/etc/salt/minion" on Linux systems.
Open the configuration file in a text editor with administrative privileges, such as "sudo" or "su" depending on your system's configuration.
2. Update the Logging Configuration
In the configuration file, find the section related to logging. It may look like this:
You can also configure the `log_level_logfile` if you want to specify a different log level for the log file.
3. Save and Close the Configuration File
4. Restart the Salt Minion
After making the changes, you need to restart the Salt Minion to apply the new logging configuration.
sudo systemctl restart salt-minion
Verify that the Salt Minion has restarted successfully.
5. View Debug Logs
Salt logs will now include debug information. You can view the logs in real-time using a command like `tail`:
sudo tail -f /var/log/salt/minion
6. Disable Debug Logging
Once you've finished debugging or troubleshooting, remember to set the `log_level` back to its original value (e.g., `'info'` or `'warning'`) to reduce log verbosity.
7. Restart the Salt Minion Again
After making any changes to the logging configuration, restart the Salt Minion to apply the changes.
By following these steps, you can enable and configure debug logging in SaltStack to help diagnose issues or gain insights into the inner workings of the Salt system.