Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fix lets the session logs go to any or all of collector/ file/syslog. To accommodate this, 2 new logger object is created for handling only SLO/Sample session destinations. The destinations to this logger are provided by the agent. A snippet of the generated_file is added to the bug. Here is a snippet of the generated sandesh file: static void LogUnrolled(std::string category, SandeshLevel::type level, const std::vector<SessionEndpoint> & session_data); static void adjust_session_end_point_objects(std::vector <SessionEndpoint> & session_data); static void Send(std::string category, SandeshLevel::type level, const std::vector<SessionEndpoint> & session_data) { if (HandleTest(level, category)) { return; } if (IsSendingAllMessagesDisabled() || IsSendingFlowsDisabled()) { UpdateTxMsgFailStats("SessionEndpointObject", 0, SandeshTxDropReason::SendingDisabled); if (IsLoggingDroppedAllowed(SandeshType::FLOW)) { Log(category, level, session_data); } return; } if (is_send_slo_to_logger_enabled() || is_send_sampled_to_logger_enabled()) { LogUnrolled(category, level, session_data); } if (level >= SendingLevel()) { UpdateTxMsgFailStats("SessionEndpointObject", 0, SandeshTxDropReason::QueueLevel); if (IsLoggingDroppedAllowed(SandeshType::FLOW)) { std::string drop_reason = "SANDESH: Queue Drop: "; DropLog(drop_reason, category, level, session_data); } return; } SessionEndpointObject * snh = new SessionEndpointObject(lseqnum_++, session_data); if (!is_send_sampled_to_collector_enabled() && !is_send_slo_to_collector_enabled()) { return; } if (is_send_sampled_to_collector_enabled() != is_send_slo_to_collector_enabled()) { adjust_session_end_point_objects(snh->session_data); } snh->set_level(level); snh->set_category(category); snh->Dispatch(); } Depends-On: I763658b0775acc2eb479b3ae373266698ce710eb Change-Id: I486656dc9d0866c395aabf9b9ed36cc129a12797 Partial-Bug: 1729812
- Loading branch information
Showing
3 changed files
with
141 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters