From e401dcb2f1cba2da1e2ef44527c55ac4f4cc7d75 Mon Sep 17 00:00:00 2001 From: JCW Date: Tue, 2 Sep 2025 22:17:01 +0100 Subject: [PATCH] Set module name in json Signed-off-by: JCW --- include/xrpl/beast/utility/Journal.h | 1 + src/libxrpl/beast/utility/beast_Journal.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/xrpl/beast/utility/Journal.h b/include/xrpl/beast/utility/Journal.h index 35d41c1c24..7082528a20 100644 --- a/include/xrpl/beast/utility/Journal.h +++ b/include/xrpl/beast/utility/Journal.h @@ -337,6 +337,7 @@ public: reset( std::source_location location, severities::Severity severity, + std::string_view moduleName, std::string_view journalAttributesJson) noexcept; }; diff --git a/src/libxrpl/beast/utility/beast_Journal.cpp b/src/libxrpl/beast/utility/beast_Journal.cpp index 97e7c47bb7..714fac3cd0 100644 --- a/src/libxrpl/beast/utility/beast_Journal.cpp +++ b/src/libxrpl/beast/utility/beast_Journal.cpp @@ -125,6 +125,7 @@ void Journal::JsonLogContext::reset( std::source_location location, severities::Severity severity, + std::string_view moduleName, std::string_view journalAttributesJson) noexcept { struct ThreadIdStringInitializer @@ -161,6 +162,8 @@ Journal::JsonLogContext::reset( } } + writer().writeKey("ModuleName"); + writer().writeString(moduleName); writer().writeKey("MessageParams"); writer().startObject(); @@ -191,7 +194,7 @@ Journal::initMessageContext( std::source_location location, severities::Severity severity) const { - currentJsonLogContext_.reset(location, severity, m_attributesJson); + currentJsonLogContext_.reset(location, severity, m_name, m_attributesJson); } std::string_view