protected ConfigurationBasedLoggingFilter(@Nonnull File file, @Nonnull @NonNullableElements LoggingRule... defaultRules) throws IllegalArgumentException { super(defaultRules); this.file = file; if (file.exists()) { reload(); } else { Files.write(comments.combine(getRules().map(LoggingRule::encode)), file); } }