Git Product home page Git Product logo

Comments (9)

josevalim avatar josevalim commented on August 16, 2024 2

Oh, I understand now. IIRC, we started adding some option for migration queries, something like :migration_source? Please inspect all telemetry metadata and see if there is something you can use.

If not, I think you can pass telemetry_options: %{dev_logger: false} to the Plug too.

Finally, you should consider sending the improvements in ecto_dev_logger upstream. I know @v0idpwn was excited about the package. At least the coloring changes should be a no-brainer. We would love to have coloring for stacktrace, for the db timing, etc. :)

from phoenix_ecto.

josevalim avatar josevalim commented on August 16, 2024

I think you can pass log: false to the check status plug? If so, can you please:

  1. Document the log: false option
  2. Change Phoenix generators to pass log: false by default?

from phoenix_ecto.

fuelen avatar fuelen commented on August 16, 2024

Sorry, I didn't get the idea with log: false.
log: false is a requirement to use my custom logger in order not to duplicate logs.
According to this code
https://github.com/elixir-ecto/ecto_sql/blob/c73ba2b1edf9d049804c2103d7dd4c9d28e6c59d/lib/ecto/adapters/sql.ex#L1107-L1120
telemetry event is published even if log: false

from phoenix_ecto.

fuelen avatar fuelen commented on August 16, 2024

Please inspect all telemetry metadata and see if there is something you can use.

Nope, here is one small example of metadata

%{
  options: [],
  params: [],
  query: "commit",
  repo: MyApp.Repo,
  result: {:ok,
   %Postgrex.Result{
     columns: nil,
     command: :commit,
     connection_id: 68112,
     messages: [],
     num_rows: nil,
     rows: nil
   }},
  source: nil,
  stacktrace: nil,
  type: :ecto_sql_query
}

Passing additional options to the Plug also does not help.

We would love to have coloring for stacktrace, for the db timing, etc. :)

Good to know, I'll open a discussion later :)

from phoenix_ecto.

josevalim avatar josevalim commented on August 16, 2024

Passing additional options to the Plug also does not help.

We should support that, so PRs here are welcome too!

from phoenix_ecto.

greg-rychlewski avatar greg-rychlewski commented on August 16, 2024

@fuelen you should now be able to see schema_migration: true in the telemetry options using ecto_sql master

from phoenix_ecto.

fuelen avatar fuelen commented on August 16, 2024

@greg-rychlewski I tried it and schema_migration: true is present only for these log lines:

CREATE TABLE IF NOT EXISTS "schema_migrations" ("version" bigint, "inserted_at" timestamp(0), PRIMARY KEY ("version"))
SELECT s0."version"::bigint FROM "schema_migrations" AS s0

so, the option is absent for begin, commit and LOCK TABLE ...

from phoenix_ecto.

josevalim avatar josevalim commented on August 16, 2024

Ah, yes. Those are in different files and we need to set them too.

from phoenix_ecto.

greg-rychlewski avatar greg-rychlewski commented on August 16, 2024

@fuelen Thanks for catching that. Now it should be fixed in ecto_sql master.

from phoenix_ecto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.