An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: logging
Andras Bacsaif75af035bbfb
diff --git a/apps/api/src/lib/buildPacks/common.ts b/apps/api/src/lib/buildPacks/common.tsindex 31a544d97c..44812a76d6 100644--- a/apps/api/src/lib/buildPacks/common.ts+++ b/apps/api/src/lib/buildPacks/common.ts@@ -472,17 +472,20 @@ export const saveBuildLog = async ({if (isDev) {console.debug(`[${applicationId}] ${addTimestamp}`);+ }+ try {+ return await got.post(`${fluentBitUrl}/${applicationId}_buildlog_${buildId}.csv`, {+ json: {+ line: encrypt(line)+ }+ })+ } catch(error) {return await prisma.buildLog.create({data: {line: addTimestamp, buildId, time: Number(day().valueOf()), applicationId}});}- return await got.post(`${fluentBitUrl}/${applicationId}_buildlog_${buildId}.csv`, {- json: {- line: encrypt(line)- }- })};diff --git a/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte b/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelteindex 1add69b029..5cee0a49af 100644--- a/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte+++ b/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte@@ -11,7 +11,7 @@import Tooltip from '$lib/components/Tooltip.svelte';import { day } from '$lib/dayjs';import { selectedBuildId } from '$lib/store';-+let logs: any = [];let currentStatus: any;let streamInterval: any;@@ -43,11 +43,13 @@status,fromDb: from} = await get(`/applications/${id}/logs/build/${$selectedBuildId}?sequence=${sequence}`);+currentStatus = status;logs = logs.concat(responseLogs.map((log: any) => ({ ...log, line: cleanAnsiCodes(log.line) })));fromDb = from;+streamInterval = setInterval(async () => {if (status !== 'running' && status !== 'queued') {clearInterval(streamInterval);@@ -60,7 +62,8 @@);status = data.status;currentStatus = status;-+ fromDb = data.fromDb;+logs = logs.concat(data.logs.map((log: any) => ({ ...log, line: cleanAnsiCodes(log.line) })));diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yamlindex 01b88c1bb0..e1934322cf 100644--- a/docker-compose-dev.yaml+++ b/docker-compose-dev.yaml@@ -3,6 +3,7 @@ version: '3.8'services:fluent-bit:image: coollabsio/coolify-fluent-bit:1.0.0+ command: /fluent-bit/bin/fluent-bit -c /fluent-bit/etc/fluent-bit-dev.confcontainer_name: coolify-fluentbitvolumes:- ./logs:/logsdiff --git a/others/fluentbit/Dockerfile b/others/fluentbit/Dockerfileindex eb0af8268e..1e271bb21e 100644--- a/others/fluentbit/Dockerfile+++ b/others/fluentbit/Dockerfile@@ -1,3 +1,4 @@FROM fluent/fluent-bit:1.9.8COPY ./fluent-bit.conf /fluent-bit/etc/fluent-bit.conf+COPY ./fluent-bit-dev.conf /fluent-bit/etc/fluent-bit-dev.confCOPY ./parsers.conf /fluent-bit/etc/parsers.conf\ No newline at end of filediff --git a/others/fluentbit/fluent-bit-dev.conf b/others/fluentbit/fluent-bit-dev.confnew file mode 100644index 0000000000..757b916655--- /dev/null+++ b/others/fluentbit/fluent-bit-dev.conf@@ -0,0 +1,30 @@+[SERVICE]+ Parsers_file /fluent-bit/etc/parsers.conf+ Flush 1+ Grace 30+[INPUT]+ Name http+ Host 0.0.0.0+ Port 24224+[FILTER]+ Name parser+ Match *+ Key_Name log+ Parser jsonparser+ Reserve_Data True+[OUTPUT]+ Name file+ Match *+ Path /logs+ Mkdir true+ Format csv+# [OUTPUT]+# Name influxdb+# match *+# Host coolify-influxdb+# Port 8086+# Database coolify+# Bucket coolify+# Org coolify+# HTTP_Token 12345678+# Sequence_Tag _seq\ No newline at end of filediff --git a/others/fluentbit/fluent-bit.conf b/others/fluentbit/fluent-bit.confindex ec9bf78bd0..bd57a17cc6 100644--- a/others/fluentbit/fluent-bit.conf+++ b/others/fluentbit/fluent-bit.conf@@ -10,7 +10,7 @@Name parserMatch *Key_Name log- Parser docker+ Parser jsonparserReserve_Data True[OUTPUT]Name filediff --git a/others/fluentbit/parsers.conf b/others/fluentbit/parsers.confindex 02f6fd02c2..1833ff5788 100644--- a/others/fluentbit/parsers.conf+++ b/others/fluentbit/parsers.conf@@ -1,5 +1,5 @@[PARSER]- Name docker+ Name jsonparserFormat jsonTime_Key timeTime_Format %Y-%m-%dT%H:%M:%S.%L