Index: src/win32/gui.c
===================================================================
--- src/win32/gui.c	(revision 4)
+++ src/win32/gui.c	(working copy)
@@ -1047,8 +1047,17 @@
 	else 
 	{
 		FILE *fd = fopen("service.log", "a");
-		fprintf(fd, "%s\n", buf);
-		fclose(fd);
+		if (fd)
+		{
+			fprintf(fd, "%s\n", buf);
+			fclose(fd);
+		}
+#ifdef _DEBUG
+		else
+		{
+		    OutputDebugString(buf);
+		}
+#endif
 	}
         va_end(ap);
 }
Index: src/win32/debug.c
===================================================================
--- src/win32/debug.c	(revision 4)
+++ src/win32/debug.c	(working copy)
@@ -230,10 +230,21 @@
 	{
 		FILE *fd = fopen("service.log", "a");
 
-		fprintf(fd, "UnrealIRCd has encountered a fatal error. Debugging information "
-			    "has been dumped to wircd.%d.core, please email this file to "
-			    "coders@lists.unrealircd.org.", getpid());
-		fclose(fd);
+		if (fd)
+		{
+			fprintf(fd, "UnrealIRCd has encountered a fatal error. Debugging information "
+					"has been dumped to wircd.%d.core, please email this file to "
+					"coders@lists.unrealircd.org.", getpid());
+			fclose(fd);
+		}
+#ifdef _DEBUG
+		else
+		{
+			OutputDebugString("UnrealIRCd has encountered a fatal error. Debugging information "
+					"has been dumped to wircd.%d.core, please email this file to "
+					"coders@lists.unrealircd.org.", getpid());
+		}
+#endif
 	}
 	CleanUp();
 	return EXCEPTION_EXECUTE_HANDLER;
