diff --git a/src/endpoints_handlers/GetUserMedicationsExecutor.h b/src/endpoints_handlers/GetUserMedicationsExecutor.h index 71b189a..d57814b 100644 --- a/src/endpoints_handlers/GetUserMedicationsExecutor.h +++ b/src/endpoints_handlers/GetUserMedicationsExecutor.h @@ -46,7 +46,7 @@ public: if (req[http::field::authorization].size() <= auth_prefix.size()) { - BOOST_LOG_TRIVIAL(info) << invalid_token_message; + BOOST_LOG_TRIVIAL(error) << invalid_token_message; throw session_exception(http::status::unauthorized, "Unauthorized"); } @@ -54,7 +54,7 @@ public: if (!auth_dao_->HasAuthorized(auth_token)) { - BOOST_LOG_TRIVIAL(info) << invalid_token_message; + BOOST_LOG_TRIVIAL(error) << invalid_token_message; throw session_exception(http::status::unauthorized, "Unauthorized"); } diff --git a/src/endpoints_handlers/PostUserMedicationsExecutor.h b/src/endpoints_handlers/PostUserMedicationsExecutor.h index 3e69e36..3918fc7 100644 --- a/src/endpoints_handlers/PostUserMedicationsExecutor.h +++ b/src/endpoints_handlers/PostUserMedicationsExecutor.h @@ -46,7 +46,7 @@ public: if (req[http::field::authorization].size() <= auth_prefix.size()) { - BOOST_LOG_TRIVIAL(info) << invalid_token_message; + BOOST_LOG_TRIVIAL(error) << invalid_token_message; throw session_exception(http::status::unauthorized, "Unauthorized"); } @@ -54,7 +54,7 @@ public: if (!auth_dao_->HasAuthorized(auth_token)) { - BOOST_LOG_TRIVIAL(info) << invalid_token_message; + BOOST_LOG_TRIVIAL(error) << invalid_token_message; throw session_exception(http::status::unauthorized, "Unauthorized"); } diff --git a/src/log/Log.cpp b/src/log/Log.cpp index 2315e20..7f9c040 100644 --- a/src/log/Log.cpp +++ b/src/log/Log.cpp @@ -14,9 +14,11 @@ void InitLogs() logging::keywords::file_name = "app_%Y-%m-%d_%H-%M-%S.log", logging::keywords::rotation_size = 10 * 1024 * 1024, logging::keywords::time_based_rotation = - logging::sinks::file::rotation_at_time_point(0, 0, 0), - logging::keywords::format = "[%TimeStamp%] [%Severity%]: %Message%" - ); + logging::sinks::file::rotation_at_time_point(0, 0, 0), + logging::keywords::format = + "[%TimeStamp%] [%Severity%]: %Message%" + ); + logging::add_common_attributes(); } }