fix(floci-core): improve floci logs structure level and clean noisy logs (#847)

* fix(floci-core): improve floci logs structure level
* fix(floci-core): revert docker-compose.yml
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-05-14 23:39:53 -05:00
1 parent b6619f8646
commit 800f4aea13
9 files changed
+27 -19

No files matched your search

@@ -21,9 +21,9 @@ public class BouncyCastleInitializer {
static {
if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
Security.addProvider(new BouncyCastleProvider());
LOG.info("Registered BouncyCastle security provider (manual fallback)");
LOG.debug("Registered BouncyCastle security provider (manual fallback)");
} else {
LOG.info("BouncyCastle provider already registered by Quarkus");
LOG.debug("BouncyCastle provider already registered by Quarkus");
}
}
@@ -34,7 +34,7 @@ public class ServiceRegistry {
List<String> enabled = new ArrayList<>();
for (ServiceDescriptor descriptor : catalog.allStatusDescriptors()) {
if (descriptor.enabled()) {
enabled.add(descriptor.externalKey());
enabled.add(descriptor.configKey());
}
}
return enabled;
@@ -18,8 +18,10 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Optional;
import java.util.SequencedSet;
/**
* Embedded UDP/53 DNS server that runs inside the Floci container and is injected
@@ -53,7 +55,7 @@ public class EmbeddedDnsServer {
static final List<String> BUILTIN_SUFFIXES = List.of(DEFAULT_SUFFIX, LOCALSTACK_SUFFIX);
private volatile String serverIp;
private final List<String> suffixes = new ArrayList<>();
private final SequencedSet<String> suffixes = new LinkedHashSet<>();
private String upstreamDns;
EmbeddedDnsServer(List<String> suffixes) {
@@ -57,7 +57,7 @@ public class StorageFactory {
Path basePath = Path.of(config.storage().persistentPath());
Path filePath = basePath.resolve(fileName);
LOG.infov("Creating {0} storage for service {1} (file: {2})", mode, serviceName, filePath);
LOG.debugv("Creating {0} storage for service {1} (file: {2})", mode, serviceName, filePath);
StorageBackend<String, V> inner = switch (mode) {
case "memory" -> new InMemoryStorage<>();
@@ -23,9 +23,11 @@ import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.event.Observes;
import jakarta.enterprise.event.ObservesAsync;
import jakarta.inject.Inject;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jboss.logging.Logger;
import java.io.IOException;
import java.util.Optional;
@ApplicationScoped
public class EmulatorLifecycle {
@@ -33,6 +35,9 @@ public class EmulatorLifecycle {
private static final Logger LOG = Logger.getLogger(EmulatorLifecycle.class);
private static final int HTTP_PORT = 4566;
@ConfigProperty(name = "quarkus.application.version", defaultValue = "")
Optional<String> appVersion = Optional.empty();
private final StorageFactory storageFactory;
private final ServiceRegistry serviceRegistry;
private final EmulatorConfig config;
@@ -79,10 +84,11 @@ public class EmulatorLifecycle {
}
void onStart(@Observes StartupEvent ignored) {
LOG.info("=== AWS Local Emulator Starting ===");
LOG.infov("Storage mode: {0}", config.storage().mode());
LOG.infov("Persistent path: {0}", config.storage().persistentPath());
LOG.infov("TLS: {0}", config.tls().enabled() ? "enabled (HTTPS + HTTP dual mode)" : "disabled (HTTP only)");
LOG.infof("=== AWS Local Emulator %s Starting ===", appVersion.orElse(""));
LOG.infof("Endpoint: http://0.0.0.0:%d", config.port());
LOG.infof("Region: %s Account: %s", config.defaultRegion(), config.defaultAccountId());
LOG.infov("Storage: {0} Path: {1}", config.storage().mode(), config.storage().persistentPath());
LOG.infov("TLS: {0}", config.tls().enabled() ? "enabled (HTTPS + HTTP dual mode)" : "disabled (HTTP only)");
// BOOT hooks run before service initialization — scripts cannot use AWS APIs yet.
try {
@@ -75,7 +75,7 @@ public class WebSocketHandler {
*/
void init(@Observes Router router) {
router.route("/ws/*").handler(this::handleWebSocketUpgrade);
LOG.info("Registered WebSocket handler on /ws/*");
LOG.debug("Registered WebSocket handler on /ws/*");
}
/**
@@ -98,10 +98,10 @@ public class Ec2MetadataServer {
httpServer = vertx.createHttpServer();
httpServer.requestHandler(router).listen(port, result -> {
if (result.succeeded()) {
LOG.infov("EC2 IMDS server listening on port {0}", port);
LOG.infof("EC2 IMDS server listening on port %d", port);
future.complete(null);
} else {
LOG.warnv("EC2 IMDS server failed to start on port {0}: {1}", port, result.cause().getMessage());
LOG.warnf("EC2 IMDS server failed to start on port %d: %s", port, result.cause().getMessage());
future.completeExceptionally(result.cause());
}
});