Skip to main content

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.php instead (under the core key). See Laravel Package.

Environment secrets

VariablePurpose
LOG_LENS_URLCanonical 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_TOKENAPI 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

KeyDefaultWhat 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+)?$/iPCRE deciding which filenames are logs. Widen for other names, e.g. /\.(log|out|err)(?:\.\d+)?$/i.
ingestion.sample_bytes65536Bytes read from a file's head for parser detection.
ingestion.capture_limit4194304Max bytes accumulated for one multiline event body.
ingestion.message_limit120000Max characters stored per group sample (message / stack / context).
ingestion.context_preview_limit12000Max characters stored for each occurrence's context preview.
pagination.default_limit50Default issue-list page size.
pagination.max_limit200Hard cap on issue-list page size.
sync.chunk_size8388608Bytes fetched per round when appending from a connector.
sync.max_discovered_files10000Safety ceiling on files one SSH pattern set may discover.
sync.prefix_hash_bytes1048576Prefix length hashed to reconcile connector streams with manual imports.
ssh.default_port22Default SSH port when a connector omits one.
ssh.connect_timeout10SSH connect timeout (seconds).
security.headers_enabledtrueSend 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_age0Strict-Transport-Security max-age in seconds; 0 = off. Only ever sent over TLS.
security.hsts_include_subdomainsfalseExtend HSTS to every subdomain. Only safe when they all serve HTTPS.
security.hsts_preloadfalseAdvertise preload-list eligibility. Effectively irreversible.
database.driversqliteStorage engine — sqlite (default), pgsql, or mysql. See Database drivers.
database.busy_timeout5000Milliseconds SQLite waits on a locked database. Only applies to the sqlite driver.
retention.processed_max_age_days0Delete archived logs older than N days after each import. 0 = off.
retention.processed_max_files0Keep 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_limit affects 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.