Grant a support principal access to canister logs

A support engineer investigating traps can read logs under an explicit visibility policy without taking over the deployment identity.

Identify the reader before changing visibility

Record the authenticated principal used by the support tool. A controller can configure log_visibility with allowed_viewers and that principal, preserving existing authorized readers. Run fetch_canister_logs under the support identity and trigger a harmless diagnostic entry in a test canister to verify the path.

controller → configure allowed viewers
support principal → fetch_canister_logs
unlisted principal → access denied

Plan for a bounded history

The log buffer is finite. Capture the relevant entries while investigating and retain record indexes and timestamps to reconstruct order. Changing who can read the buffer cannot recover discarded records. Redact sensitive values at the point where the application emits them.

Sources