Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@
final class FilesystemPropertiesLoader implements PropertiesLoader {
private final @NotNull String filePath;
private final @NotNull ILogger logger;
private boolean logNonExisting;

public FilesystemPropertiesLoader(@NotNull String filePath, @NotNull ILogger logger) {
this(filePath, logger, true);
}

public FilesystemPropertiesLoader(
@NotNull String filePath, @NotNull ILogger logger, boolean logNonExisting) {
this.filePath = filePath;
this.logger = logger;
this.logNonExisting = logNonExisting;
}

@Override
Expand All @@ -31,10 +38,12 @@ public FilesystemPropertiesLoader(@NotNull String filePath, @NotNull ILogger log
return properties;
}
} else if (!f.isFile()) {
logger.log(
SentryLevel.ERROR,
"Failed to load Sentry configuration since it is not a file or does not exist: %s",
filePath);
if (logNonExisting) {
logger.log(
SentryLevel.ERROR,
"Failed to load Sentry configuration since it is not a file or does not exist: %s",
filePath);
}
} else if (!f.canRead()) {
logger.log(
SentryLevel.ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public final class PropertiesProviderFactory {
}

final Properties runDirectoryProperties =
new FilesystemPropertiesLoader("sentry.properties", logger).load();
new FilesystemPropertiesLoader("sentry.properties", logger, false).load();
if (runDirectoryProperties != null) {
providers.add(new SimplePropertiesProvider(runDirectoryProperties));
}
Expand Down