Skip to content

Phoenix.Controller :log option no longer respected in v1.4.7+ #3483

Description

@topherhunt

In <= v1.4.6, when you use Phoenix.Controller e.g. in the autogenerated my_app_web.ex file, you could set a :log option that would either set the log level for controller-related console output, or disable it altogether. In v1.4.7 to v1.4.9, this :log option is no longer respected even though the docs still say it should work as it previously did.

I'm guessing this has something to do with the move towards Elixir telemetry.

Environment

  • Elixir version (elixir -v): 1.8.1
  • Phoenix version (mix deps): 1.4.9
  • NodeJS version (node -v): 8.9.3
  • NPM version (npm -v): 6.10.1
  • Operating system: Mac OSX 10.14.4

Expected behavior

When using Phoenix.Controller, (e.g. use Phoenix.Controller, namespace: MyAppWeb, log: false), the :log option should impact what output appears in the console.

Actual behavior

The :log option doesn't appear to have any effect, whether I set it to false or a log level atom like :info.

Repro steps

  • mix phx.new my_app (say yes to dependencies)

  • cd my_app

  • mix ecto.create

  • In lib/my_app_web.ex), set the :log option to false (or any other valid setting):

    use Phoenix.Controller, namespace: MyAppWeb, log: false
    
  • mix phx.server

  • Load the homepage in a browser. In the console, you'll see the Phoenix.Controller log output in the debug level, even though the log: false setting should have disabled it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions