Configuration
All standalone settings live in config.php,
which returns a plain array with safe defaults - it works unedited. Two
deployment secrets can also come from the environment or a .env file beside
it; a real environment variable always wins over .env.
In the Laravel adapter, these same values come from the published
config/log-lens.phpinstead (under thecorekey). See Laravel Package.
Environment secrets
| Variable | Purpose |
|---|---|
LOG_LENS_URL | Canonical base URL. Empty by default - the dashboard and API derive their base from the request. Set it only for the command-line AI skills (which have no request to derive from) or to pin a URL behind a proxy. |
LOG_LENS_TOKEN | API key. Empty = unauthenticated (local-first default). When set, every request must send it (see Security). |
.env example (git-ignored):
LOG_LENS_TOKEN=a-long-random-string
# LOG_LENS_URL=https://logs.example.com # only if you need to pin it
Settings reference
| Key | Default | What it controls |
|---|---|---|
auth.token | '' | API key; empty disables authentication. Prefer LOG_LENS_TOKEN. |
ingestion.default_severities | ["ERROR","WARNING"] | Severities a new workspace ingests. Existing workspaces keep their own choice. |
ingestion.log_file_pattern | /\.log(?:\.\d+)?$/i | PCRE deciding which filenames are logs. Widen for other names, e.g. /\.(log|out|err)(?:\.\d+)?$/i. |
ingestion.sample_bytes | 65536 | Bytes read from a file's head for parser detection. |
ingestion.capture_limit | 4194304 | Max bytes accumulated for one multiline event body. |
ingestion.message_limit | 120000 | Max characters stored per group sample (message / stack / context). |
ingestion.context_preview_limit | 12000 | Max characters stored for each occurrence's context preview. |
pagination.default_limit | 50 | Default issue-list page size. |
pagination.max_limit | 200 | Hard cap on issue-list page size. |
sync.chunk_size | 8388608 | Bytes fetched per round when appending from a connector. |
sync.max_discovered_files | 10000 | Safety ceiling on files one SSH pattern set may discover. |
sync.prefix_hash_bytes | 1048576 | Prefix length hashed to reconcile connector streams with manual imports. |
ssh.default_port | 22 | Default SSH port when a connector omits one. |
ssh.connect_timeout | 10 | SSH connect timeout (seconds). |
security.headers_enabled | true | Send the standalone hardening headers (CSP, nosniff, X-Frame-Options, Referrer-Policy, Permissions-Policy, COOP). Off if a proxy sets its own. |
security.content_security_policy | '' | Replace the built-in CSP wholesale. Empty keeps the default. |
security.hsts_max_age | 0 | Strict-Transport-Security max-age in seconds; 0 = off. Only ever sent over TLS. |
security.hsts_include_subdomains | false | Extend HSTS to every subdomain. Only safe when they all serve HTTPS. |
security.hsts_preload | false | Advertise preload-list eligibility. Effectively irreversible. |
database.driver | sqlite | Storage engine — sqlite (default), pgsql, or mysql. See Database drivers. |
database.busy_timeout | 5000 | Milliseconds SQLite waits on a locked database. Only applies to the sqlite driver. |
retention.processed_max_age_days | 0 | Delete archived logs older than N days after each import. 0 = off. |
retention.processed_max_files | 0 | Keep only the N newest archived logs. 0 = off. |
Notes:
- A bad
log_file_pattern(not a valid PCRE) is ignored and the default is used. - Changing
capture_limit/message_limitaffects only newly parsed events; run a reindex to re-apply to existing sources. - Retention only prunes the
processed/archive; indexed issues and counts are never affected. See Maintenance. - HSTS is a promise about the whole host, not about Log Lens — read the Security note before enabling it.