Skip to content

Logs & Monitoring

Der AI Application Layer stellt zwei Arten von Logs bereit: Deployment-Logs (Build- und Deploy-Prozess) und Container-Logs (Laufzeit-Ausgabe der Anwendung).


Deployment-Logs

Deployment-Logs zeigen den kompletten Ablauf eines Build-und-Deploy-Vorgangs:

  • Repository klonen
  • Docker-Image bauen
  • Container starten
  • Reverse Proxy konfigurieren

Via Oberfläche

Anwendung → “Deployments” → Deployment auswählen → “Log anzeigen”

Der Log wird in Echtzeit aktualisiert, solange das Deployment läuft.

Via API

Terminal window
# Deployment-Historie einer Anwendung
curl -s https://coolai.btc-ag.cloud/api/v1/deployments/applications/<app-uuid> \
-H "Authorization: Bearer $COOLIFY_TOKEN" \
| jq '.[] | {id, status, created_at}'
# Log eines einzelnen Deployments
curl -s https://coolai.btc-ag.cloud/api/v1/deployments/<deployment-uuid> \
-H "Authorization: Bearer $COOLIFY_TOKEN" \
| jq '.logs'

Container-Logs (Laufzeit)

Container-Logs sind die Standardausgaben (stdout/stderr) eurer laufenden Anwendung — also alles, was ihr mit console.log, logger.info oder äquivalenten Methoden ausgebt.

Via Oberfläche

Anwendung → “Logs” — zeigt die letzten Zeilen in Echtzeit.

Via API

Terminal window
# Aktuelle Logs der laufenden Instanz
curl -s https://coolai.btc-ag.cloud/api/v1/applications/<app-uuid>/logs \
-H "Authorization: Bearer $COOLIFY_TOKEN"

Logging-Best-Practices

Damit Logs nützlich sind, sollte eure Anwendung:

Strukturiert loggen (JSON)

// Empfohlen: JSON-Format für maschinelle Auswertbarkeit
console.log(JSON.stringify({
level: 'info',
message: 'Request verarbeitet',
path: '/api/users',
duration_ms: 42,
timestamp: new Date().toISOString()
}));

Log-Level verwenden

DEBUG — Detaillierte Diagnoseinformationen (nur Entwicklung)
INFO — Normaler Betriebsablauf
WARN — Unerwartete, aber handhabbare Situationen
ERROR — Fehler, die Aufmerksamkeit erfordern

Keine Secrets in Logs

// Schlecht
console.log(`Verbinde mit DB: ${databaseUrl}`);
// Gut
console.log('Datenbankverbindung wird aufgebaut');

Statusüberwachung

Der aktuelle Status jeder Anwendung ist im Dashboard sichtbar:

StatusBedeutung
runningAnwendung läuft und ist erreichbar
stoppedManuell gestoppt
restartingNeustart läuft
exitedContainer beendet (Fehler prüfen)

Via API

Terminal window
# Status aller Ressourcen auf einem Server
curl -s https://coolai.btc-ag.cloud/api/v1/servers/<server-uuid>/resources \
-H "Authorization: Bearer $COOLIFY_TOKEN" \
| jq '.[] | {name: .name, status: .status}'

Deployment bei Fehler abbrechen

Läuft ein Deployment und ihr merkt, dass etwas schiefläuft:

Terminal window
# Laufendes Deployment abbrechen
curl -s -X POST \
https://coolai.btc-ag.cloud/api/v1/deployments/<deployment-uuid>/cancel \
-H "Authorization: Bearer $COOLIFY_TOKEN"