diff --git a/indra/llplugin/llplugininstance.cpp b/indra/llplugin/llplugininstance.cpp
index 773dcf7cdaaf292a4fe8dc5b58f67a3415aea2f8..9e9aac98f179890e4cfd6c76f98f4e51e57b1e0d 100644
--- a/indra/llplugin/llplugininstance.cpp
+++ b/indra/llplugin/llplugininstance.cpp
@@ -137,7 +137,9 @@ void LLPluginInstance::sendMessage(const std::string &message)
 {
 	if(mPluginSendMessageFunction)
 	{
+#ifdef SHOW_DEBUG
 		LL_DEBUGS("Plugin") << "sending message to plugin: \"" << message << "\"" << LL_ENDL;
+#endif
 		mPluginSendMessageFunction(message.c_str(), &mPluginUserData);
 	}
 	else
@@ -172,7 +174,9 @@ void LLPluginInstance::receiveMessage(const char *message_string)
 {
 	if(mOwner)
 	{
-		LL_DEBUGS("Plugin") << "processing incoming message: \"" << message_string << "\"" << LL_ENDL;		
+#if SHOW_DEBUG
+		LL_DEBUGS("Plugin") << "processing incoming message: \"" << message_string << "\"" << LL_ENDL;
+#endif
 		mOwner->receivePluginMessage(message_string);
 	}
 	else
diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp
index d93ec8cf4b9417f1cae66953c597792d459217ae..e5ae0dd34fb3408692180625b8831c0f43a5710e 100644
--- a/indra/llplugin/llpluginprocesschild.cpp
+++ b/indra/llplugin/llpluginprocesschild.cpp
@@ -320,7 +320,9 @@ void LLPluginProcessChild::sendMessageToPlugin(const LLPluginMessage &message)
 	{
 		std::string buffer = message.generate();
 
+#ifdef SHOW_DEBUG
 		LL_DEBUGS("Plugin") << "Sending to plugin: " << buffer << LL_ENDL;
+#endif
 		LLTimer elapsed;
 
 		mInstance->sendMessage(buffer);
@@ -337,7 +339,9 @@ void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message)
 {
 	std::string buffer = message.generate();
 
+#if SHOW_DEBUG
 	LL_DEBUGS("Plugin") << "Sending to parent: " << buffer << LL_ENDL;
+#endif
 
 	writeMessageRaw(buffer);
 }
@@ -345,8 +349,9 @@ void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message)
 void LLPluginProcessChild::receiveMessageRaw(const std::string &message)
 {
 	// Incoming message from the TCP Socket
-
+#if SHOW_DEBUG
 	LL_DEBUGS("Plugin") << "Received from parent: " << message << LL_ENDL;
+#endif
 
 	// Decode this message
 	LLPluginMessage parsed;
@@ -485,7 +490,9 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message)
 /* virtual */
 void LLPluginProcessChild::receivePluginMessage(const std::string &message)
 {
+#if SHOW_DEBUG
 	LL_DEBUGS("Plugin") << "Received from plugin: " << message << LL_ENDL;
+#endif
 
 	if (mBlockingRequest)
 	{
@@ -568,7 +575,9 @@ void LLPluginProcessChild::receivePluginMessage(const std::string &message)
 
 	if (passMessage)
 	{
+#if SHOW_DEBUG
 		LL_DEBUGS("Plugin") << "Passing through to parent: " << message << LL_ENDL;
+#endif
 		writeMessageRaw(message);
 	}
 
@@ -589,7 +598,9 @@ void LLPluginProcessChild::receivePluginMessage(const std::string &message)
 
 void LLPluginProcessChild::setState(EState state)
 {
+#if SHOW_DEBUG
 	LL_DEBUGS("Plugin") << "setting state to " << state << LL_ENDL;
+#endif
 	mState = state;
 };
 
diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp
index 78f6edc1211864c297ced602a619e0fb75e1bf24..1a09c2b3ea9b52b9ab96d54d20a5b8524cede2c0 100644
--- a/indra/llplugin/llpluginprocessparent.cpp
+++ b/indra/llplugin/llpluginprocessparent.cpp
@@ -120,7 +120,9 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner):
 
 LLPluginProcessParent::~LLPluginProcessParent()
 {
+#ifdef SHOW_DEBUG
 	LL_DEBUGS("Plugin") << "destructor" << LL_ENDL;
+#endif
     if (pProcessCreationThread)
     {
         if (!pProcessCreationThread->isStopped())
@@ -1295,7 +1297,9 @@ std::string LLPluginProcessParent::getPluginVersion(void)
 
 void LLPluginProcessParent::setState(EState state)
 {
+#ifdef SHOW_DEBUG
 	LL_DEBUGS("Plugin") << "setting state to " << state << LL_ENDL;
+#endif
 	mState = state; 
 };
 
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp
index 0511952fee6ce3dd53fee449d3b464953ff5c9d5..00b0dafa2b3f5093149a27647cf366eae2969953 100644
--- a/indra/media_plugins/cef/media_plugin_cef.cpp
+++ b/indra/media_plugins/cef/media_plugin_cef.cpp
@@ -862,17 +862,23 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
 					mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_DOWN, x, y);
 					mCEFLib->setFocus();
 
-					std::stringstream str;
-					str << "Mouse down at = " << x << ", " << y;
-					postDebugMessage(str.str());
+					if(mEnableMediaPluginDebugging)
+					{
+						std::stringstream str;
+						str << "Mouse down at = " << x << ", " << y;
+						postDebugMessage(str.str());
+					}
 				}
 				else if (event == "up" && button == 0)
 				{
 					mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_UP, x, y);
 
-					std::stringstream str;
-					str << "Mouse up at = " << x << ", " << y;
-					postDebugMessage(str.str());
+					if (mEnableMediaPluginDebugging)
+					{
+						std::stringstream str;
+						str << "Mouse up at = " << x << ", " << y;
+						postDebugMessage(str.str());
+					}
 				}
 				else if (event == "double_click")
 				{