Skip to main content
Version: 7.0

S3 storage for background task logs

Overview

Background task logs are stored locally in ./files/logs/tasks/ by default. To use S3-compatible storage, configure the parameters in the config file.

Required for fault-tolerant configurations

In fault-tolerant environments, background tasks run on each application server node: one node may run N tasks, another node its own set. The Background Tasks tab in the web interface only shows logs from the current node. To view logs from tasks that ran on another node, you must connect to that node directly. With S3 storage, all logs are available from a single store, and you can view them in the web interface without switching between nodes.

Config file

S3 parameters are set in .env.local (or .env in Docker), located at:

  • Linux/var/www/.env.local
  • Windows ServerC:\inetpub\wwwroot\passwork\.env.local
  • Docker/<passwork>/.env
info

If the file does not exist, create it.

Parameters

ParameterDescription
APP_FILES_SOURCEStorage source: files.storage.local (default) or files.storage.aws (S3).
S3_REGIONBucket region.
S3_BUCKETBucket name.
S3_STORAGE_PREFIXPath prefix inside the bucket (e.g. passwork-logs).
S3_STORAGE_KEYS3 access key.
S3_STORAGE_SECRETS3 secret key.
S3_ENDPOINTStorage endpoint. Omit for AWS S3.
S3_USE_PATH_STYLE_ENDPOINTPath-style addressing: 0 — virtual-hosted style, 1 — path style (use 1 for MinIO).

Logs are saved at — {S3_STORAGE_PREFIX}logs/tasks/YYYY/MM/DD/task-{taskId}.log

Examples

AWS

APP_FILES_SOURCE=files.storage.aws
S3_REGION=us-east-1
S3_BUCKET=pwk
S3_STORAGE_PREFIX=passwork-logs
S3_STORAGE_KEY=AKIAIOSFODNN7EXAMPLE
S3_STORAGE_SECRET=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
S3_USE_PATH_STYLE_ENDPOINT=0

MinIO

APP_FILES_SOURCE=files.storage.aws
S3_REGION=us-east-1
S3_BUCKET=pwk
S3_STORAGE_PREFIX=passwork-logs
S3_ENDPOINT=https://minio.example.com
S3_USE_PATH_STYLE_ENDPOINT=1
S3_STORAGE_KEY=webapp-logs
S3_STORAGE_SECRET=1GV6qaFpMYR11zs0VDEy

DigitalOcean Spaces

APP_FILES_SOURCE=files.storage.aws
S3_REGION=nyc3
S3_BUCKET=pwk
S3_STORAGE_PREFIX=passwork-logs
S3_ENDPOINT=https://nyc3.digitaloceanspaces.com
S3_USE_PATH_STYLE_ENDPOINT=0
S3_STORAGE_KEY=your-spaces-access-key
S3_STORAGE_SECRET=your-spaces-secret-key

Google Cloud Storage

APP_FILES_SOURCE=files.storage.aws
S3_REGION=us-east1
S3_BUCKET=pwk
S3_STORAGE_PREFIX=passwork-logs
S3_ENDPOINT=https://storage.googleapis.com
S3_USE_PATH_STYLE_ENDPOINT=0
S3_STORAGE_KEY=your-gcs-hmac-access-id
S3_STORAGE_SECRET=your-gcs-hmac-secret

After changing parameters, restart the PHP-FPM service or Docker container:

systemctl restart php8.3-fpm