diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp
index 3a656b8f099f..36e57d6017ab 100644
--- a/src/libcamera/base/log.cpp
+++ b/src/libcamera/base/log.cpp
@@ -718,11 +718,15 @@ void Logger::registerCategory(LogCategory *category)
 
 	const std::string &name = category->name();
 	for (const std::pair<std::string, LogSeverity> &level : levels_) {
+		unsigned int i;
+		bool wildcard = false;
 		bool match = true;
 
-		for (unsigned int i = 0; i < level.first.size(); ++i) {
-			if (level.first[i] == '*')
+		for (i = 0; i < level.first.size(); ++i) {
+			if (level.first[i] == '*') {
+				wildcard = true;
 				break;
+			}
 
 			if (i >= name.size() ||
 			    name[i] != level.first[i]) {
@@ -731,6 +735,10 @@ void Logger::registerCategory(LogCategory *category)
 			}
 		}
 
+		/* Ensure the full name got matched */
+		if (!(wildcard || i == name.size()))
+			continue;
+
 		if (match) {
 			category->setSeverity(level.second);
 			break;
