wazuh / wazuh-agent

Wazuh agent, the Wazuh agent for endpoints.
GNU Affero General Public License v3.0
25 stars 16 forks source link

Friendly log connection attempts #255

Open vikman90 opened 4 days ago

vikman90 commented 4 days ago

Parent Issue: https://github.com/wazuh/wazuh-agent/issues/241

When the agent cannot connect to the manager, it floods the log with messages of this type:

[2024-10-28 16:53:50.965] [wazuh-agent] [error] [ERROR] [http_client.cpp:188] [PerformHttpRequest ] Error: connect: Connection refused [system:111 at /root/wazuh-agent/build/vcpkg_installed/x64-linux/include/boost/asio/detail/reactive_socket_service.hpp:587:33 in function 'boost::system: :error_code boost::asio::detail::reactive_socket_service::connect(implementation_type &, const endpoint_type &, boost::system::error_code &) [Protocol = boost::asio::ip::tcp]']. [2024-10-28 16:53:50.965] [wazuh-agent] [error] [ERROR] [http_client.cpp:211] [AuthenticateWithUuidAndKey] Error: 500 . [2024-10-28 16:53:50.965] [wazuh-agent] [error] [ERROR] [communicator.cpp:63] [SendAuthenticationRequest] Failed to authenticate with the manager.

These logs should be more user-friendly and less numerous. Let's take inspiration from the 4.x agent:

vikman90 commented 1 day ago

Update

October 31

aritosteles commented 12 hours ago

Update

October 31

Rebased work branch. Getting clarification on the issue's requirements and looking into logger library.

November 1

Trying different logger configurations. Leaning to multisynk approach. Further testing needed.