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

Change sai log level before discovery to prevent SAI ERR spam to the log #316

Merged
merged 14 commits into from
May 14, 2018

Conversation

pavel-shirshov
Copy link
Contributor

Change the level of sai api log to critical right before discovery and set it back to notice after the discovery to prevent error messages caused by discovery process

@lguohan
Copy link
Contributor

lguohan commented May 7, 2018

@kcudnik to check.

@pavel-shirshov pavel-shirshov merged commit 39a5d14 into sonic-net:master May 14, 2018
@pavel-shirshov pavel-shirshov deleted the pavelsh/loglevel branch May 14, 2018 21:10
@qiluo-msft
Copy link
Contributor

@pavel-shirshov @lguohan This pull request will reset all the SAI components' loglevel back to NOTICE. It breaks loglevel for warm-reboot

Suggest store the previous loglevel, and restore back.

@@ -937,8 +937,9 @@ void SaiSwitch::helperDiscover()

{
SWSS_LOG_TIMER("discover");

set_sai_api_log_min_prio("SAI_LOG_LEVEL_CRITICAL");
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this is critical ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because otherwise sai will dump to syslog many thousands of the error messages "something not found" when syncd discover sai api". Output to syslog seriously hits cpu which increases fast-reboot time

Copy link
Collaborator

Choose a reason for hiding this comment

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

there is nothing that produces critical message, so nothing would be logged except maybe something from internal sai
i would propose to log SAI_STATUS_NOT_IMPLEMENTED (which is the most errors probably) as info message in discovery method, instead of disabling all messages in this way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Kamil,

Yes. I made that level CRITICAL because no messages are produced by SAI on syncd discovery.
I had a patch making SAI_STATUS_NOT_IMPLEMENTED as INFO in SAI. I'm not sure it's still there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yea that would be better approach, so other meaningfull errors if present they still would be logged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants