Add a check to drop the event from being logged in the buffer if it
exceeds the maximum WDM Notification message limit.
diff --git a/src/lib/core/WeaveError.cpp b/src/lib/core/WeaveError.cpp
index 699b50f..875f723 100644
--- a/src/lib/core/WeaveError.cpp
+++ b/src/lib/core/WeaveError.cpp
@@ -232,6 +232,7 @@
     case WEAVE_ERROR_SESSION_KEY_SUSPENDED                      : desc = "Session key suspended"; break;
     case WEAVE_ERROR_UNSUPPORTED_WIRELESS_REGULATORY_DOMAIN     : desc = "Unsupported wireless regulatory domain"; break;
     case WEAVE_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION    : desc = "Unsupported wireless operating location"; break;
+    case WEAVE_ERROR_WDM_EVENT_TOO_BIG                          : desc = "The WDM Event is too big to be successfully transmitted to a peer node"; break;
     }
 #endif // !WEAVE_CONFIG_SHORT_ERROR_STR
 
diff --git a/src/lib/core/WeaveError.h b/src/lib/core/WeaveError.h
index 096294d..2cadb51 100644
--- a/src/lib/core/WeaveError.h
+++ b/src/lib/core/WeaveError.h
@@ -1757,6 +1757,17 @@
  */
 #define WEAVE_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION      _WEAVE_ERROR(185)
 
+/**
+ *  @def WEAVE_ERROR_WDM_EVENT_TOO_BIG
+ *
+ *  @brief
+ *    The specified event is too big to be successfully transmitted to a peer node,
+ *    e.g., it exceeds the maximum WDM Notification message size
+ *    limit.
+ *
+ */
+#define WEAVE_ERROR_WDM_EVENT_TOO_BIG                            _WEAVE_ERROR(186)
+
 
 /**
  *  @}
diff --git a/src/lib/profiles/data-management/Current/LoggingManagement.cpp b/src/lib/profiles/data-management/Current/LoggingManagement.cpp
index d15a18b..411ef17 100644
--- a/src/lib/profiles/data-management/Current/LoggingManagement.cpp
+++ b/src/lib/profiles/data-management/Current/LoggingManagement.cpp
@@ -1314,6 +1314,8 @@
         CircularEventBuffer * buffer = mEventBuffer;
         do
         {
+            VerifyOrExit((WDM_MAX_NOTIFICATION_SIZE - WDM_NOTIFY_REQUEST_META_INFO_BYTES_MAX) >= writer.GetLengthWritten(),
+                         err = WEAVE_ERROR_WDM_EVENT_TOO_BIG);
             VerifyOrExit(buffer->mBuffer.GetQueueSize() >= writer.GetLengthWritten(), err = WEAVE_ERROR_BUFFER_TOO_SMALL);
             if (buffer->IsFinalDestinationForImportance(inSchema.mImportance))
                 break;
@@ -1329,6 +1331,7 @@
     if (err != WEAVE_NO_ERROR)
     {
         mEventBuffer->mBuffer = checkpoint;
+        WeaveLogError(EventLogging, "Failed to log event for profile id: 0x%x (err: %d)", inSchema.mProfileId, err);
     }
     else if (inSchema.mImportance <= GetCurrentImportance(inSchema.mProfileId))
     {
diff --git a/src/lib/profiles/data-management/Current/NotificationEngine.h b/src/lib/profiles/data-management/Current/NotificationEngine.h
index 792b89a..22cfad7 100644
--- a/src/lib/profiles/data-management/Current/NotificationEngine.h
+++ b/src/lib/profiles/data-management/Current/NotificationEngine.h
@@ -33,6 +33,13 @@
 #include <Weave/Profiles/data-management/TraitData.h>
 #include <Weave/Profiles/data-management/TraitCatalog.h>
 
+// Reserve bytes that would account for additional formulation overhead
+// of a Notify Request(beyond the event and the data lists) containing
+// meta information, e.g., SubscriptionId, etc. This is a conservative
+// estimate that should serve as a loose upper bound, and help in bounding
+// the maximum size of a WDM event.
+#define WDM_NOTIFY_REQUEST_META_INFO_BYTES_MAX  (64)
+
 namespace nl {
 namespace Weave {
 namespace Profiles {
diff --git a/src/test-apps/TestErrorStr.cpp b/src/test-apps/TestErrorStr.cpp
index 6716cbf..51655db 100644
--- a/src/test-apps/TestErrorStr.cpp
+++ b/src/test-apps/TestErrorStr.cpp
@@ -294,6 +294,7 @@
       WEAVE_ERROR_SESSION_KEY_SUSPENDED,
       WEAVE_ERROR_UNSUPPORTED_WIRELESS_REGULATORY_DOMAIN,
       WEAVE_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION,
+      WEAVE_ERROR_WDM_EVENT_TOO_BIG,
 
       WEAVE_ERROR_TUNNEL_ROUTING_RESTRICTED,