Git Product home page Git Product logo

Comments (16)

LannyBose avatar LannyBose commented on August 24, 2024 4

Just FYI in case someone ends up here via the Google, verbose: false is no longer current. Since July 2020, log: false is the correct config, based on this commit.

from oban.

lpil avatar lpil commented on August 24, 2024 3

Hi all! Just thought I'd share that Elixir's logger has the per-application log purging built in, so you can do this with any library without having to add additional logic to the library itself.

https://hexdocs.pm/logger/Logger.html#module-application-configuration

config :logger,
  compile_time_purge_matching: [
    [application: :foo, level_lower_than: :info]
  ]

from oban.

andykent avatar andykent commented on August 24, 2024 1

Just a quick note to say I just hit this too, was about to create an issue and noticed these changes on master. I just tried it out and it solved things for me 100% so thanks so much for all your hard work.

from oban.

sorentwo avatar sorentwo commented on August 24, 2024 1

When I set queues: false it stops.

Interesting. I wonder if this is from the connection checkout. Can you try using master and see if it persists?

from oban.

sorentwo avatar sorentwo commented on August 24, 2024

@tomtaylor Great suggestion. This is something that I've found annoying as well. Typically I would set the overall log level to :info, but that isn't always desirable during development.

With the changes in b127e73 you can now setverbose: false in your top level configuration and the queries won't be logged at all. Please give it a try and let me know how it goes for you πŸ‘

from oban.

tomtaylor avatar tomtaylor commented on August 24, 2024

@sorentwo brilliant, thank you!

from oban.

sorentwo avatar sorentwo commented on August 24, 2024

@andykent Glad you found this issue and that it is working out for you. Thank you so much for the kind words as well! πŸ’›

from oban.

andykent avatar andykent commented on August 24, 2024

Oh awesome! That’s really nice.

Thanks for taking the time to show that @lpil

from oban.

hisapy avatar hisapy commented on August 24, 2024

Hi @sorentwo

I'm having a similar issue here on 1.2.0, in my case every ~1 second in my dev console I'm getting the following

[debug] QUERY OK db=1.7ms
commit []
[debug] QUERY OK db=1.7ms
commit []
[debug] QUERY OK db=0.2ms
begin []
[debug] QUERY OK db=0.2ms
begin []
[debug] QUERY OK db=1.6ms
commit []

Tried verbose: false but didn't work ... Is there a way I can turn off those messages so I can keep on using my IEx?

Sorry if I had to create a new issue instead of replying in a closed one and thank you very much for his awesome lib.

from oban.

sorentwo avatar sorentwo commented on August 24, 2024

Hi all! Just thought I'd share that Elixir's logger has the per-application log purging built in, so you can do this with any library without having to add additional logic to the library itself.

Somehow I never saw this comment before! I would have mentioned that Oban isn't the application doing the logging, it is all coming from Ecto itself.

Tried verbose: false but didn't work ... Is there a way I can turn off those messages so I can keep on using my IEx?

That's strange. There are only three uses of transactions in Oban and all three of them are setting the log option. Are you sure this is from Oban? Does it continue if you set queues: false?

from oban.

hisapy avatar hisapy commented on August 24, 2024

When I set queues: false it stops.

from oban.

hisapy avatar hisapy commented on August 24, 2024

Sorry for taking too long to respond. I just installed from master branch and when started my app got the following error:

[error] GenServer Oban.Queue.AchDebits.Producer terminating
** (UndefinedFunctionError) function Payments.Repo.default_options/1 is undefined or private
    (payments 0.1.0) Payments.Repo.default_options(:update_all)
    (ecto 3.4.2) lib/ecto/repo/queryable.ex:203: Ecto.Repo.Queryable.prepare_query/4
    (ecto 3.4.2) lib/ecto/repo/queryable.ex:174: Ecto.Repo.Queryable.execute/4
    (oban 1.2.0) lib/oban/query.ex:113: Oban.Query.rescue_orphaned_jobs/2
    (oban 1.2.0) lib/oban/queue/producer.ex:196: Oban.Queue.Producer.rescue_orphans/1
    (oban 1.2.0) lib/oban/queue/producer.ex:65: Oban.Queue.Producer.handle_continue/2
    (stdlib 3.11) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib 3.11) gen_server.erl:388: :gen_server.loop/7
    (stdlib 3.11) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Going to look for that default_options function but let me know if you have a quick answer.

from oban.

sorentwo avatar sorentwo commented on August 24, 2024

It seems like you have something in your app that is modifying queries before they are sent. Maybe a prepare_query callback? That may be overriding the log setting that Oban is passing.

from oban.

hisapy avatar hisapy commented on August 24, 2024

No, this app is very tiny yet. It's actually starting so there's not much going on.

EDIT: ExAudit is being used and in fact it replaces the Ecto.Repo so maybe the problem is coming from there. Let me see.

from oban.

hisapy avatar hisapy commented on August 24, 2024

I fixed the problem in ExAudit in this PR

Thx and stay safe devs.

from oban.

sorentwo avatar sorentwo commented on August 24, 2024

Thanks @hisapy!

from oban.

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.