Hello! I just recorded a video for the SAS Technical Insights and Expertise Series channel on YouTube:
Viewing Logs with SAS Viya Monitoring for Kubernetes: Changing Log Levels
In the video, I show the full process of troubleshooting an example configuration issue in a SAS Viya deployment. In order to diagnose the problem, we adjust the SAS Viya identities service’s logging level to produce more detailed log messages, which is done using both SAS Environment Manager and the sas-viya CLI. During the rest of the troubleshooting process, we explore those log messages in Kibana, the main web interface in the log monitoring stack of the open-source SAS Viya Monitoring for Kubernetes project in GitHub: https://github.com/sassoftware/viya4-monitoring-kubernetes.
The video features two small bash code snippets, which I wanted to share here.
1. CLI command shown in the video to delete the identities logging.level configuration – assumes ansi-colors-enabled is false in your current CLI profile, and assumes you have successfully authenticated in the CLI as a user in the SAS Administrators group:
sas-viya --output text configuration configurations delete --id $(sas-viya --output text configuration configurations list | grep identities | grep logging.level | awk '{print $1}')
2. CLI commands to create a configuration instance to set the logging.level for the identities service to TRACE:
tee /tmp/identities.logging.level.trace.json > /dev/null << EOF { "version": 2, "accept": "application/vnd.sas.configuration.config+json", "count": 1, "name": "configurations", "items": [ { "metadata": { "isDefault": false, "mediaType": "application/vnd.sas.configuration.config.logging.level+json;version=1", "services": [ "identities" ] }, "version": 1, "level": "TRACE", "name": "com.sas.identities" } ] } EOF sas-viya configuration configurations create --file /tmp/identities.logging.level.trace.json
Hopefully sharing them here saves some typing.
See you next time!
Find more articles from SAS Global Enablement and Learning here.
A colleague just kindly suggested another way to use the CLI, this time to update the value of a logging level configuration instance using sas-viya configuration configurations update:
tee /tmp/identities.logging.level.info.json > /dev/null << EOF
{ "version": 2, "accept": "application/vnd.sas.configuration.config+json", "count": 1, "name": "configurations", "items": [ { "metadata": { "isDefault": false, "mediaType": "application/vnd.sas.configuration.config.logging.level+json;version=1", "services": [ "identities" ] }, "version": 1, "level": "TRACE", "name": "com.sas.identities" } ] } EOF sas-viya configuration configurations update --file /tmp/identities.logging.level.info.json
That also works. Thanks for the suggestion @BrunoMueller!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.