62 lines
1.4 KiB
Markdown
62 lines
1.4 KiB
Markdown
# Cara Cek Backend Logs
|
|
|
|
## Lokasi Log File
|
|
Backend logs ditulis ke: `/tmp/backend-api.log`
|
|
|
|
## Cara Melihat Logs
|
|
|
|
### 1. Lihat Logs Real-time (Live)
|
|
```bash
|
|
tail -f /tmp/backend-api.log
|
|
```
|
|
|
|
### 2. Lihat Logs Terakhir (50 baris)
|
|
```bash
|
|
tail -50 /tmp/backend-api.log
|
|
```
|
|
|
|
### 3. Filter Logs untuk Error ZFS Pool
|
|
```bash
|
|
tail -100 /tmp/backend-api.log | grep -i "zfs\|pool\|create\|error\|failed"
|
|
```
|
|
|
|
### 4. Lihat Logs dengan Format JSON yang Lebih Readable
|
|
```bash
|
|
tail -50 /tmp/backend-api.log | jq '.'
|
|
```
|
|
|
|
### 5. Monitor Logs Real-time untuk ZFS Pool Creation
|
|
```bash
|
|
tail -f /tmp/backend-api.log | grep -i "zfs\|pool\|create"
|
|
```
|
|
|
|
## Restart Backend
|
|
|
|
Backend perlu di-restart setelah perubahan code untuk load route baru:
|
|
|
|
```bash
|
|
# 1. Cari process ID backend
|
|
ps aux | grep calypso-api | grep -v grep
|
|
|
|
# 2. Kill process (ganti PID dengan process ID yang ditemukan)
|
|
kill <PID>
|
|
|
|
# 3. Restart backend
|
|
cd /development/calypso/backend
|
|
export CALYPSO_DB_PASSWORD="calypso123"
|
|
export CALYPSO_JWT_SECRET="test-jwt-secret-key-minimum-32-characters-long"
|
|
go run ./cmd/calypso-api -config config.yaml.example > /tmp/backend-api.log 2>&1 &
|
|
|
|
# 4. Cek apakah backend sudah running
|
|
sleep 3
|
|
tail -20 /tmp/backend-api.log
|
|
```
|
|
|
|
## Masalah yang Ditemukan
|
|
|
|
Dari logs, terlihat:
|
|
- **Status 404** untuk `POST /api/v1/storage/zfs/pools`
|
|
- Route sudah ada di code, tapi backend belum di-restart
|
|
- **Solusi**: Restart backend untuk load route baru
|
|
|