commit 0573b43075391a13466a568304155e9466b5aa40 parent 18f341d3b71e8a0761ac813acdaaea91526ce23a Author: Antoine A <> Date: Fri, 19 Dec 2025 10:01:44 +0100 common: server listening logging Diffstat:
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/libeufin-bank/src/main/kotlin/tech/libeufin/bank/cli/Serve.kt b/libeufin-bank/src/main/kotlin/tech/libeufin/bank/cli/Serve.kt @@ -60,7 +60,7 @@ class Serve: TalerCmd("serve") { db.conn { it.execSQLUpdate(sqlProcedures.readText()) } // Remove conversion info from the database ? } - serve(cfg.serverCfg) { + serve(cfg.serverCfg, logger) { corebankWebApp(db, cfg) } } diff --git a/libeufin-common/src/main/kotlin/api/server.kt b/libeufin-common/src/main/kotlin/api/server.kt @@ -288,12 +288,13 @@ fun Application.talerApi(logger: Logger, routes: Routing.() -> Unit) { // Dirty local variable to stop the server in test TODO remove this ugly hack var engine: ApplicationEngine? = null -fun serve(cfg: tech.libeufin.common.ServerConfig, api: Application.() -> Unit) { +fun serve(cfg: tech.libeufin.common.ServerConfig, logger: Logger, api: Application.() -> Unit) { val server = embeddedServer(CIO, configure = { when (cfg) { is ServerConfig.Tcp -> { for (addr in InetAddress.getAllByName(cfg.addr)) { + logger.info("Listening on ${addr.hostAddress}:${cfg.port}") connector { port = cfg.port host = addr.hostAddress @@ -301,6 +302,7 @@ fun serve(cfg: tech.libeufin.common.ServerConfig, api: Application.() -> Unit) { } } is ServerConfig.Unix -> { + logger.info("Listening on ${cfg.path}") unixConnector(cfg.path) } } diff --git a/libeufin-ebisync/src/main/kotlin/tech/libeufin/ebisync/cli/Serve.kt b/libeufin-ebisync/src/main/kotlin/tech/libeufin/ebisync/cli/Serve.kt @@ -72,7 +72,7 @@ class Serve : TalerCmd() { clientKeys, bankKeys ) - serve(cfg.serverCfg) { + serve(cfg.serverCfg, logger) { ebisyncApi(auth, client, cfg.spa) } } diff --git a/libeufin-nexus/src/main/kotlin/tech/libeufin/nexus/cli/Serve.kt b/libeufin-nexus/src/main/kotlin/tech/libeufin/nexus/cli/Serve.kt @@ -64,7 +64,7 @@ class Serve : TalerCmd("serve") { } cfg.withDb { db, cfg -> - serve(cfg.serverCfg) { + serve(cfg.serverCfg, logger) { nexusApi(db, cfg) } }