Index: xword/XWikiLib/Logging/Log.cs =================================================================== --- xword/XWikiLib/Logging/Log.cs (revision 19784) +++ xword/XWikiLib/Logging/Log.cs (working copy) @@ -23,13 +23,17 @@ /// The type of the message. public static void Write(String message, EventLogEntryType type) { + //The message for EventLog can not exceed 32766 bytes + int MAX_MSG_SIZE = 32766; + String msg = (message.Length > MAX_MSG_SIZE) ? message.Substring(0, MAX_MSG_SIZE) : message; + if (EventLog.Exists(logName)) { EventLog.CreateEventSource(eventSource, logName); } else { - EventLog.WriteEntry(eventSource, message, type); + EventLog.WriteEntry(eventSource, msg, type); } }