diff --git a/e-invoice-api/build.gradle.kts b/e-invoice-api/build.gradle.kts index 431f2b6..36bd23a 100644 --- a/e-invoice-api/build.gradle.kts +++ b/e-invoice-api/build.gradle.kts @@ -13,6 +13,9 @@ kotlin { val quarkusVersion: String by project +val klfVersion: String by project +val lokiLogAppenderVersion: String by project + dependencies { implementation(enforcedPlatform("io.quarkus.platform:quarkus-bom:$quarkusVersion")) implementation("io.quarkus:quarkus-kotlin") @@ -25,6 +28,12 @@ dependencies { implementation("io.quarkus:quarkus-micrometer") implementation("io.quarkus:quarkus-micrometer-registry-prometheus") + implementation(project(":e-invoicing-domain")) + + implementation("net.codinux.log:klf:$klfVersion") + implementation("net.codinux.log:quarkus-loki-log-appender:$lokiLogAppenderVersion") + implementation("net.codinux.log.kubernetes:codinux-kubernetes-info-retriever:$lokiLogAppenderVersion") + testImplementation("io.quarkus:quarkus-junit5") testImplementation("io.rest-assured:rest-assured") diff --git a/e-invoice-api/src/main/resources/application.properties b/e-invoice-api/src/main/resources/application.properties index e69de29..e6d25d7 100644 --- a/e-invoice-api/src/main/resources/application.properties +++ b/e-invoice-api/src/main/resources/application.properties @@ -0,0 +1,88 @@ + +# HTTP config + +%dev.quarkus.http.host=0.0.0.0 +%dev.quarkus.http.port=8091 + +quarkus.http.enable-compression=true + +quarkus.http.cors=true +quarkus.http.cors.origins=* +quarkus.http.cors.headers=accept, authorization, content-type, x-requested-with +quarkus.http.cors.methods=GET, OPTIONS + + +# log request response times +quarkus.http.access-log.enabled=true +quarkus.http.record-request-start-time=true +# for all variables see: https://quarkus.io/guides/http-reference#configuring-http-access-logs +# %h Remote host name +# %s HTTP status code of the response +# %D Time taken to process the request, in millis +# %r First line of the request +# %b Bytes sent, excluding HTTP headers, or '-' if no bytes were sent +quarkus.http.access-log.pattern=%h %s %D ms "%r" %b bytes + + +# Logging + +quarkus.log.console.async=true + +quarkus.log.loki.host-url=http://loki.monitoring:3100 +%dev.quarkus.log.loki.host-url=http://localhost:3100 +%dev.quarkus.log.loki.enable=false +%test.quarkus.log.loki.enable=false + +quarkus.log.loki.field.app.include=true + +quarkus.log.loki.field.kubernetes.include=true +%dev.quarkus.log.loki.field.kubernetes.include=false +quarkus.log.loki.field.kubernetes.prefix=off +quarkus.log.loki.field.kubernetes.field.containername.include=false + + +# Live reload + +quarkus.live-reload.instrumentation=true + +# disable this output: +# Press [h] for more options> +# Tests paused +# Press [r] to resume testing, [h] for more options> +# Press [r] to resume testing, [o] Toggle test output, [h] for more options> +quarkus.test.continuous-testing=disabled +quarkus.console.disable-input=true + +# disable Analytics +quarkus.analytics.disabled=true + + +# Quarkus Native settings + +quarkus.native.enable-https-url-handler=true +quarkus.native.enable-all-security-services=true + + +# Metrics and Health + +# Kubernetes / Prometheus won't find endpoints under /q/health, /q/metrics, ..., so remove /q (= Quarkus default sub path) from path +quarkus.micrometer.export.prometheus.path=/metrics + +quarkus.smallrye-health.root-path=/health +quarkus.smallrye-health.ui.always-include=true + + +# OpenAPI and Swagger-UI + +# so that in Kubernetes Swagger-UI, Health UI, ... can be reached under /party-events (under /q/ it's not reachable via ingress) +quarkus.http.root-path=/invoicing +quarkus.http.non-application-root-path=${quarkus.http.root-path} + +quarkus.swagger-ui.always-include=true +quarkus.swagger-ui.theme=flattop +quarkus.swagger-ui.display-request-duration=true + +quarkus.smallrye-openapi.info-title=eInvoicing +quarkus.smallrye-openapi.info-version=1.0.0 +quarkus.smallrye-openapi.info-description=API to create an read eInvoices according to EU standard EN 16931 +quarkus.smallrye-openapi.info-contact-email=dev@codinux.net \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 2f80ff9..c57c557 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,6 +15,7 @@ mustangVersion=2.14.2 angusMailVersion=2.0.3 klfVersion=1.6.2 +lokiLogAppenderVersion=0.5.5 # only used for tests logbackVersion=1.5.12