quantum-elixir / quantum-core

:watch: Cron-like job scheduler for Elixir
https://hexdocs.pm/quantum/
Apache License 2.0
2.28k stars 148 forks source link

Problem: Debugging Mechanism For Job Execution #350

Closed techgaun closed 5 years ago

techgaun commented 5 years ago

Currently, the job execution logging mechanism seems to be only possible on debug level which is not what is always turned on in production environment.

I think the debug_logging should be replaced with quantum_log_level and that should be used via Logger.log/3 so we can actually control the logging level quantum uses. Thoughts?

maennchen commented 5 years ago

I don't think that this is a good idea. Quantum already logs with different log levels. The logs emitted with the debug level are actually debug information and should always be logged with the corresponding log level. If you really need to see the debug information, you should switch the log level to debug therefore. (Also to debug the production environment.)

If you need more flexibility to control which Module / Application logs which level, I recommend you to use an improved logger backend that supports that. This would for example be FlexLogger.

techgaun commented 5 years ago

@maennchen I see what you're saying. FlexLogger solves my problem, indeed. Thanks for pointing me to that direction. As a side question, is it possible to provide pre-execution function to be invoked/called for quantum. I have bunch of functions that could be called via api call/internal tasks but also via cron and I would ideally love to log the fact that it is being invoked via cron. I could probably have a parameter or something to indicate that but I was wondering if there's a way to log that the function is being invoked via cronjob. As for this issue, I am closing this as that clears my issue. Thanks again!