From 480d6cb42868bd4d89ffec1b524445f1fd73167e Mon Sep 17 00:00:00 2001 From: melloware Date: Wed, 25 Oct 2023 10:55:26 -0400 Subject: [PATCH] Allow ClamAV to disable container logging --- .../antivirus/deployment/ClamAVBuildConfig.java | 7 +++++++ .../quarkiverse/antivirus/deployment/ClamAVContainer.java | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/deployment/src/main/java/io/quarkiverse/antivirus/deployment/ClamAVBuildConfig.java b/deployment/src/main/java/io/quarkiverse/antivirus/deployment/ClamAVBuildConfig.java index 9f09d42..e91e813 100644 --- a/deployment/src/main/java/io/quarkiverse/antivirus/deployment/ClamAVBuildConfig.java +++ b/deployment/src/main/java/io/quarkiverse/antivirus/deployment/ClamAVBuildConfig.java @@ -54,6 +54,13 @@ public interface ClamAVBuildConfig { @WithDefault("false") boolean freshClam(); + /** + * Enable or disable ClamAV container logging + */ + @WithName("devservice.logging") + @WithDefault("true") + boolean logging(); + /** * If ClamAv registers in the health check by pinging the service. */ diff --git a/deployment/src/main/java/io/quarkiverse/antivirus/deployment/ClamAVContainer.java b/deployment/src/main/java/io/quarkiverse/antivirus/deployment/ClamAVContainer.java index f2ba550..f331d47 100644 --- a/deployment/src/main/java/io/quarkiverse/antivirus/deployment/ClamAVContainer.java +++ b/deployment/src/main/java/io/quarkiverse/antivirus/deployment/ClamAVContainer.java @@ -48,7 +48,9 @@ public final class ClamAVContainer extends GenericContainer { "/etc/clamav/clamd.conf"); // forward the container logs - super.withLogConsumer(new JbossContainerLogConsumer(log).withPrefix(NAME)); + if (config.logging()) { + super.withLogConsumer(new JbossContainerLogConsumer(log).withPrefix(NAME)); + } } @Override @@ -90,4 +92,4 @@ public static String getTcpHost() { return ConfigProvider.getConfig().getOptionalValue("quarkus.antivirus.clamav.host", String.class).orElse("localhost"); } -} +} \ No newline at end of file