Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command to update log level and refresh configuration #3428

Merged
merged 4 commits into from
Oct 12, 2024

Conversation

Junchao-Mellanox
Copy link
Collaborator

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
Copy link
Collaborator Author

/azpw run Azure.sonic-utilities

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-utilities

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Junchao-Mellanox Junchao-Mellanox force-pushed the master-log branch 2 times, most recently from baa004d to d633c46 Compare July 19, 2024 08:44
@Junchao-Mellanox
Copy link
Collaborator Author

Hi @prgeor , kindly reminder

@xincunli-sonic
Copy link
Contributor

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

@Junchao-Mellanox
Copy link
Collaborator Author

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.

@liat-grozovik
Copy link
Collaborator

@prgeor can you please help to review comment feedback ?

return

log_config = cfg_db.get_entry('LOGGER', identifier)
require_manual_refresh = log_config.get('require_manual_refresh')
Copy link
Contributor

@prgeor prgeor Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Junchao-Mellanox Who add this configuration to config DB and when?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python logger will add this to config DB in init function. Check this PR https://github.com/sonic-net/sonic-buildimage/pull/19611/files line 62

Copy link

linux-foundation-easycla bot commented Sep 27, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Fix review comment
@prgeor prgeor merged commit 88ef85c into sonic-net:master Oct 12, 2024
7 checks passed
bradh352 added a commit to bradh352/sonic-buildimage that referenced this pull request Nov 29, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
bradh352 added a commit to bradh352/sonic-buildimage that referenced this pull request Nov 29, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
bradh352 added a commit to bradh352/sonic-buildimage that referenced this pull request Dec 1, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Dec 1, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
bradh352 added a commit to bradh352/sonic-buildimage that referenced this pull request Dec 1, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Dec 3, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Dec 3, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Dec 4, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Dec 4, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Dec 5, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Dec 6, 2024
As of sonic-net#19611
and sonic-net/sonic-utilities#3428
a new database field of `require_manual_refresh` was added.

This leads to YANG failures in the factory-default configuration
for the `xcvrd` log entry which by default is written as true.

Signed-off-by: Brad House (@bradh352)
StormLiangMS pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Dec 6, 2024
Why I did it
YANG failures during config replace with default configuration.

As of #19611 and sonic-net/sonic-utilities#3428 a new database field of require_manual_refresh was added.

This leads to YANG failures in the factory-default configuration for the xcvrd log entry which by default is written as true.

Work item tracking
How I did it
Updated YANG file for new field.

How to verify it
Verify config replace works with factory default configuration.
VladimirKuk pushed a commit to Marvell-switching/sonic-buildimage that referenced this pull request Jan 21, 2025
Why I did it
YANG failures during config replace with default configuration.

As of sonic-net#19611 and sonic-net/sonic-utilities#3428 a new database field of require_manual_refresh was added.

This leads to YANG failures in the factory-default configuration for the xcvrd log entry which by default is written as true.

Work item tracking
How I did it
Updated YANG file for new field.

How to verify it
Verify config replace works with factory default configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants