sonic-utilities
sonic-utilities copied to clipboard
Add a command to update log level and refresh configuration
What I did
Add a command "config syslog level" to set log level at runtime.
How I did it
Add a command "config syslog level" to set log level at runtime. This command shall update log level in CONFIG DB and send SIGHUP to relevant daemon if it requires a manual refresh
How to verify it
manual test new unit test case
Previous command output (if the output of a command-line utility has changed)
N/A
New command output (if the output of a command-line utility has changed)
root@sonic:/home/admin# config syslog level --help
Usage: config syslog level [OPTIONS]
Configure log level
Options:
-c, --component TEXT Component name in DB for which loglevel is
applied (provided with -l) [required]
-l, --level [DEBUG|INFO|NOTICE|WARN|ERROR]
Loglevel value [required]
--service TEXT Container name to which the SIGHUP is sent
(provided with --pid or --program)
--program TEXT Program name to which the SIGHUP is sent
(provided with --service)
--pid TEXT Process ID to which the SIGHUP is sent
(provided with --service if PID is from
container)
-?, -h, --help Show this message and exit.
/azpw run Azure.sonic-utilities
/AzurePipelines run Azure.sonic-utilities
Azure Pipelines successfully started running 1 pipeline(s).
Hi @prgeor , kindly reminder
Hi @Junchao-Mellanox, as debug purpose, do you want to add it into show cli?
Hi @Junchao-Mellanox, as debug purpose, do you want to add it into show cli?
There is an existing command swssloglevel -p which can be used to print the configured log level.
@prgeor can you please help to review comment feedback ?