Skip to content

Configuration ​

Publish the config to change it:

bash
php artisan vendor:publish --tag=lumberjack-config

Connection ​

KeyEnvDefault
enabledLUMBERJACK_ENABLEDtruefalse turns Lumberjack off: nothing is recorded or sent, @lumberjack renders nothing, health checks are not scheduled and the webhook route answers 404. The commands still run and say so; the agent sends nothing and waits to be stopped
urlLUMBERJACK_URLThe Lumberjack server
tokenLUMBERJACK_TOKENThe project's server token; only the agent uses it
public_keyLUMBERJACK_PUBLIC_KEYFor browser errors; without it @lumberjack renders nothing
environmentLUMBERJACK_ENVIRONMENTAPP_ENV
releaseLUMBERJACK_RELEASEWins over the resolver; see Release
release_resolver[Git, Composer]Works out the release when LUMBERJACK_RELEASE is empty; see Release
browser_userLUMBERJACK_BROWSER_USERfalseWhether @lumberjack puts the signed-in user's id on the page; see The signed-in user
announceLUMBERJACK_ANNOUNCEAPP_DEBUGWhether the browser script says hello in the console

Release ​

Lumberjack tags every exception, request and job with the release, so it can tell when an issue started or came back. LUMBERJACK_RELEASE sets it. When it is empty, the release_resolver works it out once per process.

The default tries two resolvers and uses the first that finds a release:

php
use ExeQue\Lumberjack\Release\ComposerReleaseResolver;
use ExeQue\Lumberjack\Release\GitReleaseResolver;

'release_resolver' => [
    GitReleaseResolver::class,
    ComposerReleaseResolver::class,
],
ResolverRelease
GitReleaseResolverThe commit checked out in the app's .git directory, read without running git. Follows branches (loose or packed refs), a detached HEAD and worktrees.
ComposerReleaseResolverThe commit composer install ran in, from vendor/composer/installed.php. Survives a deploy that copies the app without .git, as long as vendor was installed in a git checkout (e.g. on CI).
FileReleaseResolverThe first line of a file the deploy writes. See below.
StackReleaseResolverThe first release found by its resolvers, tried in order. A plain list in release_resolver is one; you rarely name it yourself.

All resolvers live in ExeQue\Lumberjack\Release.

A deploy that copies files without .git (rsync, an artifact, a Docker image) can write the release to a file at build time and read it with FileReleaseResolver. The path is relative to the app's root:

bash
git rev-parse HEAD > latest-release   # before rsync
php
// config/lumberjack.php: the file first, then the defaults
use ExeQue\Lumberjack\Release\FileReleaseResolver;

'release_resolver' => [
    [FileReleaseResolver::class, 'file' => 'latest-release'],
    GitReleaseResolver::class,
    ComposerReleaseResolver::class,
],

It reads the first line of the file, and REVISION when no file is given. An absolute path (starting with /) works too. A missing or empty file means no release.

release_resolver takes a list of entries, tried in order, or a single entry. An entry is a class, or [Class::class, 'parameter' => value].

Your own class works too: implement ExeQue\Lumberjack\Contracts\ReleaseResolver. The container makes it with those constructor parameters, so other dependencies are injected, and passes the app's root as path if the constructor takes one:

php
use ExeQue\Lumberjack\Contracts\ReleaseResolver;
use Illuminate\Contracts\Cache\Repository;

final class DeployedRelease implements ReleaseResolver
{
    public function __construct(private readonly Repository $cache, private readonly string $key) {}

    public function resolve(): ?string
    {
        $release = $this->cache->get($this->key);

        return is_string($release) ? $release : null;
    }
}
php
'release_resolver' => [App\Support\DeployedRelease::class, 'key' => 'deploy:release'],

Set it to null to send no release.

Agent ​

KeyEnvDefault
agent.hostLUMBERJACK_AGENT_HOST127.0.0.1Where the agent listens and the app sends
agent.portLUMBERJACK_AGENT_PORT2407
agent.nameLUMBERJACK_AGENT_NAMEthe hostWhat Lumberjack lists the agent as
agent.keyLUMBERJACK_AGENT_KEYderived from the tokenThe secret on every line the app hands the agent; app and agent must agree. See Who may talk to it
agent.interval5Seconds between batches
agent.send_timeoutLUMBERJACK_AGENT_SEND_TIMEOUT5Seconds one send to Lumberjack may take before it is retried from the spool
agent.spool_pathstorage/lumberjack/spoolWhere unsent batches wait
agent.spool_max_bytes100 MBPast this, the oldest batches go
agent.memory_limitLUMBERJACK_AGENT_MEMORY128MB before the agent exits for a fresh one; 0 is no limit
queuesLUMBERJACK_QUEUESthe default queueQueues whose size the heartbeat reports, comma separated in the env; see Queue sizes

Recording ​

See What is recorded for what each section covers, and Sampling for the sample rates and thresholds.

The ignore lists of routes, queries, jobs, queues, commands and scheduled tasks take * wildcards; a route matches on its URI (orders/{order}) or its path (orders/42). ignore_methods, ignore_status and ignore_connections match exactly, and exceptions.ignore takes classes, which ignore their subclasses too.

KeyEnvDefault
requests.enabledLUMBERJACK_REQUESTStrue
requests.sample_rateLUMBERJACK_SAMPLE_RATE1.0
requests.always_slower_than_msLUMBERJACK_REQUESTS_ALWAYS_SLOWER_THAN_MS1000
requests.ignoreup, horizon*, telescope*, _debugbar*
requests.ignore_methodsOPTIONS, HEAD
requests.ignore_statusnone
queries.enabledLUMBERJACK_QUERIEStrue
queries.slower_than_msLUMBERJACK_QUERIES_SLOWER_THAN_MS0
queries.always_slower_than_msLUMBERJACK_QUERIES_ALWAYS_SLOWER_THAN_MS500
queries.ignorenone
queries.ignore_connectionsnone
queries.locationLUMBERJACK_QUERY_LOCATIONtrue
jobs.enabledLUMBERJACK_JOBStrue
jobs.sample_rateLUMBERJACK_JOBS_SAMPLE_RATE1.0
jobs.always_slower_than_msLUMBERJACK_JOBS_ALWAYS_SLOWER_THAN_MS5000
jobs.ignorenone
jobs.ignore_queuesnone
jobs.parametersLUMBERJACK_JOB_PARAMETERStrue
exceptions.enabledLUMBERJACK_EXCEPTIONStrue
exceptions.ignorenone
commands.enabledLUMBERJACK_COMMANDStrue
commands.sample_rateLUMBERJACK_COMMANDS_SAMPLE_RATE1.0
commands.always_slower_than_msLUMBERJACK_COMMANDS_ALWAYS_SLOWER_THAN_MS10000
commands.ignoreworkers and other long-running commands
schedule.enabledLUMBERJACK_SCHEDULEtrue
schedule.sample_rateLUMBERJACK_SCHEDULE_SAMPLE_RATE1.0
schedule.always_slower_than_msLUMBERJACK_SCHEDULE_ALWAYS_SLOWER_THAN_MS10000
schedule.ignorenone

Spans ​

See Spans.

KeyEnvDefault
spans.cacheLUMBERJACK_SPANS_CACHEtrue
spans.httpLUMBERJACK_SPANS_HTTPtrue
spans.mailLUMBERJACK_SPANS_MAILtrue
spans.notificationsLUMBERJACK_SPANS_NOTIFICATIONStrue
spans.redisLUMBERJACK_SPANS_REDISfalseTurns on Redis events for it
spans.ignore_cache_keysnoneCache keys to leave out, * wildcards; the framework's own are always left out

Health checks ​

See Health checks.

KeyEnvDefault
health.scheduleLUMBERJACK_HEALTH_SCHEDULE* * * * *When the scheduler runs lumberjack:health; null to leave it out
health.one_serverLUMBERJACK_HEALTH_ONE_SERVERtrueRun it on one server only
health.checks[]Checks, besides those registered with Lumberjack::healthChecks()
health.cooldownLUMBERJACK_HEALTH_COOLDOWN30Seconds between results fired from code with Lumberjack::health($slug), per slug; 0 turns it off
health.states.storeLUMBERJACK_HEALTH_STATES_STOREnullCache store the states are kept in; the default store when null. The agent and the app must share it, see Reading states
health.states.ttlLUMBERJACK_HEALTH_STATES_TTL30Seconds stored states count as fresh; older ones are fetched from Lumberjack, at most once per ttl
health.states.pullLUMBERJACK_HEALTH_STATES_PULLtrueFetch states from Lumberjack when they are older than the ttl; false leaves them to the agent
health.states.memoLUMBERJACK_HEALTH_STATES_MEMO5Seconds a process keeps the states it read before reading the cache again; 0 reads every time

Webhook ​

See Reacting to alerts.

KeyEnvDefault
webhook.enabledLUMBERJACK_WEBHOOK_ENABLEDfalseWhether the route exists
webhook.secretLUMBERJACK_WEBHOOK_SECRETThe channel's signing secret
webhook.pathLUMBERJACK_WEBHOOK_PATHlumberjack/webhook

Other ​

KeyDefault
base_pathbase_path()Where the app's own code lives: a frame under it and outside vendor/ is in-app, query locations are found from it, and the release resolvers look for .git and REVISION there
scrub.keysnoneExtra sensitive keys, on top of the defaults (* wildcards). See Scrubbing
scrub.replace_defaultsfalsetrue: only scrub.keys, none of the built-in keys
scrub.patternsnoneRegular expressions whose matches are blanked in any string
scrub.session_keysnoneSession keys sent with an exception; the rest of the session is left out
scrub.query_keysnoneQuery-string keys whose values are sent; every other value is blanked, also in URLs inside messages