Update logging in DataManager to use debug level for message skipping and insertion confirmation
- Changed log level from info to debug for skipping messages to Kafka topic. - Added debug log for successful message insertion into MongoDB collection.
This commit is contained in:
@@ -178,7 +178,7 @@ class DataManager:
|
|||||||
)
|
)
|
||||||
self.logger.error(trace)
|
self.logger.error(trace)
|
||||||
else:
|
else:
|
||||||
self.logger.info(f"Skipping message to topic {topic}: {data}")
|
self.logger.debug(f"Skipping message to topic {topic}: {data}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
collection = self.mongo_db[topic]
|
collection = self.mongo_db[topic]
|
||||||
@@ -189,6 +189,8 @@ class DataManager:
|
|||||||
"inserted_at": datetime.now(timezone.utc),
|
"inserted_at": datetime.now(timezone.utc),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
self.logger.debug(
|
||||||
|
f"Message inserted into MongoDB collection {topic}: {data}")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
trace = traceback.format_exc()
|
trace = traceback.format_exc()
|
||||||
|
|||||||
Reference in New Issue
Block a user