mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds request IDs and URIs to the debug log
This commit is contained in:
@@ -29,6 +29,12 @@ void CustomDebugLog::write(int level, const std::string& message) {
|
||||
m_log << "[" << level << "] " << message << std::endl;
|
||||
}
|
||||
|
||||
void CustomDebugLog::write(int level, const std::string &id,
|
||||
const std::string &uri, const std::string &msg) {
|
||||
std::string msgf = "[" + std::to_string(level) + "] " + msg;
|
||||
msgf = "[" + id + "] [" + uri + "] " + msgf;
|
||||
m_log << msgf << std::endl;
|
||||
}
|
||||
|
||||
bool CustomDebugLog::contains(const std::string& pattern) {
|
||||
modsecurity::Utils::Regex re(pattern);
|
||||
|
@@ -29,6 +29,8 @@ class CustomDebugLog : public modsecurity::debug_log::DebugLog {
|
||||
~CustomDebugLog();
|
||||
|
||||
void write(int level, const std::string& message) override;
|
||||
void write(int level, const std::string &id,
|
||||
const std::string &uri, const std::string &msg) override;
|
||||
bool contains(const std::string& pattern);
|
||||
std::string log_messages();
|
||||
std::string error_log_messages();
|
||||
|
Reference in New Issue
Block a user