Skip to content

feat: make separate access log opt-in via ACCESS_LOG_FILE_PATH - #2205

Merged
venimus merged 1 commit into
masterfrom
feat/access-log-opt-in
Sep 8, 2026
Merged

venimus merged 1 commit into
masterfrom
feat/access-log-opt-in

Conversation

@venimus

@venimus venimus commented Sep 8, 2026

Copy link
Copy Markdown
Member

Why

ACCESS_LOG_FILE_PATH (#2199) always defaulted to log/access.log even when
unset, meaning every deployment silently started splitting HTTP access lines
into a second file/backend and detaching Phoenix's default request logger,
whether or not that was wanted.

What

  • config/runtime.exs: access_log_file_path is now nil unless
    ACCESS_LOG_FILE_PATH is explicitly set (no computed default). The
    :access_log logger config, its LoggerFileBackend entry, and :info's
    metadata_reject are only applied when it's set.
  • lib/ae_mdw/application.ex: AeMdw.APM.AccessLogger.attach() (which
    detaches Phoenix's own request-logging telemetry handlers) only runs when
    Application.get_env(:logger, :access_log) is configured.

When the env var is unset, behavior is byte-for-byte the same as before #2199
ever existed: single combined info.log, Phoenix's default request logger
untouched. Opting in requires explicitly setting ACCESS_LOG_FILE_PATH.

Verification

  • mix format --check-formatted && mix credo — clean.
  • mix dialyzer --format github — passed successfully.
  • mix test test/ae_mdw_web/ — 537/537 passing.

Previously the access-log split (#2199) always defaulted to log/access.log
even when ACCESS_LOG_FILE_PATH wasn't set. Now it's nil unless the env var
is explicitly set:
- config/runtime.exs: no default path, :access_log backend/config only
  configured when set, :info's metadata_reject only applies then too.
- application.ex: AccessLogger.attach() (which detaches Phoenix's own
  request-logging handlers) only runs when :access_log is configured.

When unset, behavior is 100% unchanged from before #2199: single combined
info.log, Phoenix's default request logger untouched.
@venimus
venimus merged commit bfe10ef into master Sep 8, 2026
7 checks passed
@venimus
venimus deleted the feat/access-log-opt-in branch September 8, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant