Add swss-common log level support to GNMI service #330
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add swss-common log level support to GNMI service
Why I did it
Improve GNMI debug experience
How I did it
Initialize swss-common log level thread when GNMI start.
How to verify it
Manually test:
admin@vlab-01:
$ swssloglevel -l NOTICE -c telemetry$ sudo tail -f /var/log/syslogadmin@vlab-01:
2024 Nov 22 05:30:03.876827 vlab-01 DEBUG gnmi#telemetry: :> select: enter
2024 Nov 22 05:30:04.734015 vlab-01 INFO systemd[1]: Starting sysstat-collect.service - system activity accounting tool...
2024 Nov 22 05:30:04.740683 vlab-01 INFO systemd[1]: Starting logrotate.service - Rotate log files...
2024 Nov 22 05:30:04.750069 vlab-01 DEBUG gnmi#telemetry: :< select: exit
2024 Nov 22 05:30:04.754189 vlab-01 DEBUG gnmi#telemetry: :- swssPrioNotify: Changing logger minPrio to NOTICE
Add new UT.
Work item tracking
Microsoft ADO (number only): 30298614
Which release branch to backport (provide reason below if selected)
Description for the changelog
Add swss-common log level support to GNMI service
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)