sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

Add a command to update log level and refresh configuration

Open Junchao-Mellanox opened this issue 1 year ago • 7 comments

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.

Junchao-Mellanox avatar Jul 18 '24 02:07 Junchao-Mellanox

/azpw run Azure.sonic-utilities

Junchao-Mellanox avatar Jul 19 '24 06:07 Junchao-Mellanox

/AzurePipelines run Azure.sonic-utilities

mssonicbld avatar Jul 19 '24 06:07 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jul 19 '24 06:07 azure-pipelines[bot]

Hi @prgeor , kindly reminder

Junchao-Mellanox avatar Aug 05 '24 06:08 Junchao-Mellanox

Hi @Junchao-Mellanox, as debug purpose, do you want to add it into show cli?

xincunli-sonic avatar Aug 09 '24 17:08 xincunli-sonic

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.

Junchao-Mellanox avatar Aug 12 '24 01:08 Junchao-Mellanox

@prgeor can you please help to review comment feedback ?

liat-grozovik avatar Sep 03 '24 08:09 liat-grozovik

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: Junchao-Mellanox (cb721341d8ada9bfb0be02de69193177f626f52c, c5fe5744e17d5cbcd0a6857846ca4daddc5d79b3, 02c77e471eb86be9419cc43b6aa386c4f6014a15, 1b6aac700b934dcbd8118b48dd4529810a2c4e98)