diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/CompileEnvironmentUtil.java b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/CompileEnvironmentUtil.java
index ca09d542ccc..d63f31eba10 100644
--- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/CompileEnvironmentUtil.java
+++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/CompileEnvironmentUtil.java
@@ -169,7 +169,7 @@ public class CompileEnvironmentUtil {
String message = "Source file or directory not found: " + sourceRootPath;
File moduleFilePath = configuration.get(JVMConfigurationKeys.MODULE_XML_FILE);
- if (moduleFilePath != null) {
+ if (moduleFilePath != null && Logger.isInitialized()) {
String moduleFileContent = FileUtil.loadFile(moduleFilePath);
LOG.warn(message +
"\n\nmodule file path: " + moduleFilePath +
diff --git a/compiler/testData/cli/jvm/nonexistentPathInModule.out b/compiler/testData/cli/jvm/nonexistentPathInModule.out
index 1bb449f0e60..56f17b9ff22 100644
--- a/compiler/testData/cli/jvm/nonexistentPathInModule.out
+++ b/compiler/testData/cli/jvm/nonexistentPathInModule.out
@@ -1,25 +1,3 @@
-WARN: Source file or directory not found: $TESTDATA_DIR$/nonexistentFile.kt
-
-module file path: compiler/testData/cli/jvm/nonexistentPathInModule.xml
-content:
-
-
-
-
-
-
-
-WARN: Source file or directory not found: $TESTDATA_DIR$/some/nonexistent/dir
-
-module file path: compiler/testData/cli/jvm/nonexistentPathInModule.xml
-content:
-
-
-
-
-
-
-
error: source file or directory not found: $TESTDATA_DIR$/nonexistentFile.kt
error: source file or directory not found: $TESTDATA_DIR$/some/nonexistent/dir
COMPILATION_ERROR