io.quarkiverse.logging.splunk.SplunkLogHandlerRecorder Maven / Gradle / Ivy
/*
Copyright (c) 2023 Amadeus s.a.s.
Contributor(s): Kevin Viet, Romain Quinio, Yohann Puyhaubert (Amadeus s.a.s.)
*/
package io.quarkiverse.logging.splunk;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.stream.Collectors;
import org.jboss.logmanager.formatters.PatternFormatter;
import org.jboss.logmanager.handlers.AsyncHandler;
import com.splunk.logging.HttpEventCollectorErrorHandler;
import com.splunk.logging.HttpEventCollectorSender;
import com.splunk.logging.hec.MetadataTags;
import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.annotations.Recorder;
@Recorder
public class SplunkLogHandlerRecorder {
public RuntimeValue> initializeHandler(SplunkConfig rootConfig) {
if (!rootConfig.config.enabled) {
return new RuntimeValue<>(Optional.empty());
}
Handler handler = buildHandlerFromConfig(rootConfig.config);
return new RuntimeValue<>(Optional.of(handler));
}
public RuntimeValue
© 2015 - 2025 Weber Informatics LLC | Privacy Policy