aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job/logging.rb
Commit message (Collapse)AuthorAgeFilesLines
* Adding enque time tracking and loggingCory Gwin @gwincr112019-02-131-1/+1
| | | | | | | | | | | | | | | Motivation: - Currently we have 2 seperate monkey patches in place for tracking enqueded time for 2 seperate workers. It seems that activejob could be a source of truth for how long an item has been enqued so that we can easily use it for consistent monitoring across workers/apps to ensure that jobs are running at an acceptable speed. Changes: - Add an enqueded at attribute and serilization tooling. - Add a method to get how long a job has been enqueded for. - Add a logging item to show how long a job was enqued prior to the perform method firing.
* Improve `enqueue_retry.active_job` messagebogdanvlviv2018-09-251-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since #33751 was added `enqueue_retry.active_job` instrumentation to the `retry_on` method, then #33897 moved the instrumentation to `retry_job` method in order to ensure that this method publish `enqueue_retry.active_job` notification too. See related discussion https://github.com/rails/rails/pull/33751#discussion_r214140008 Since `enqueue_retry.active_job` moved to `retry_job`, there is no guarantee that payload of `enqueue_retry.active_job` would have `:error`. See test `LoggingTest#test_enqueue_retry_logging_on_retry_job` as example of that case. Related to https://github.com/rails/rails/pull/33897#discussion_r219707024 I think we can improve notification of `enqueue_retry.active_job`: - If there is no `event.payload[:error]`, then publish like "Retrying RescueJob in 3 seconds." only. - If `event.payload[:wait]` is `nil`, then publish "Retrying RescueJob in 0 seconds." instead of "Retrying RescueJob in nil seconds." - If there is `event.payload[:error]`, then publish "Retrying RescueJob in 3 seconds, due to a DefaultsError.". - Change the type of the message from `error` to `info.` Also, this commit removes part of messages - "The original exception was #{ex.cause.inspect}." of `enqueue_retry.active_job`, `retry_stopped.active_job`, and `discard.active_job` since I haven't found it useful. Please let me know whether you agree with that?
* `retry_job` should publish `enqueue_retry.active_job` notificationbogdanvlviv2018-09-161-1/+1
| | | | | | | | | | Also this commit removes `:wait` from payload of `retry_stopped.active_job`. Related to https://github.com/rails/rails/pull/33751#discussion_r214140008 Follow up #33751 /cc @kaspth, @rafaelfranca
* Move ActiveJob retry and discard logging into log subscriberSteve S2018-08-301-0/+28
|
* [ci skip] Fixup changelog. Trim title. Mention benefit.Kasper Timm Hansen2018-07-201-4/+4
|
* Wrap ActiveJob::Enqueue in evented ActiveSupport::Notificationzvkemp2018-07-171-3/+3
|
* Remove passing extra arguments to ActiveJob Callbacksbogdanvlviv2018-02-231-2/+2
|
* Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-171-1/+0
| | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* [Active Job] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveJobKir Shatrov2017-07-091-0/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-031-1/+1
|
* Add error logging to Active JobSteven Bull2017-03-271-3/+10
| | | | | | | | | | | | | | | | | | | | Active Job logging instrumentation is changed to log errors (with backtrace) when a job raises an exception in #perform. This improves debugging during development and test with the default configuration. Prior to Rails 5, the default development configuration ran jobs with InlineAdapter, which would raise exceptions to the caller and be shown in the development log. In Rails 5, the default adapter was changed to AsyncAdapter, which would silently swallow exceptions and log a "Performed SomeJob from Async..." info message. This could be confusing to a developer, as it would seem that the job was performed successfully. This patch removes the "Performed..." info message from the log and adds an error-level "Error performing SomeJob..." log message which includes the exception backtrace for jobs that raise an exception within the #perform method. It provides this behavior for all adapters.
* Include JobID in all ActiveJob info logsBolek Kurowski2017-02-221-2/+2
| | | | | | | | | | Currently we provide the Job ID in logs only related to enqueuing a job. This adds the job id to the remaining ActiveJob logs when: - a job started performing - a job ended performing Providing the job id in those logs will ease searching logs by job id.
* Add three new rubocop rulesRafael Mendonça França2016-08-161-2/+2
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-50/+50
|
* applies new string literal convention in activejob/libXavier Noria2016-08-061-8/+8
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix jobs overriding AJ::Base#loggerJean Boussier2016-06-171-1/+1
|
* Merge pull request #20116 from cristianbica/activejob-enqueue-loggingArthur Nogueira Neves2015-10-041-1/+1
|\ | | | | ActiveJob - log enqueued message only after the job was successfully enqueued
| * ActiveJob - log enqueued message only after the job was successfully enqueuedCristian Bica2015-05-111-1/+1
| |
* | Properly log nested parameters to Active JobMarek Pieczyk2015-09-081-1/+15
|/ | | | Refactor arguments logging method for Active Job
* `ActiveJob::QueueAdapters::*` are no longer singletonsTamir Duberstein2015-03-111-1/+1
|
* Inline to_global_id conversionAri Pollak2014-12-041-5/+1
|
* Use try instead of checking for GlobalID::IdentificationAri Pollak2014-12-041-5/+1
|
* Only filter GIDable objects; remove cosmetic changesAri Pollak2014-12-011-6/+4
|
* Hide potentially sensitive ActiveJob params from logsAri Pollak2014-11-281-1/+16
| | | | * Show GlobalID instead of full object .inspect output
* Remove redundant `to_s` in interpolationrochefort2014-11-041-1/+1
|
* Add documentation on Active Job.mo khan2014-10-021-1/+1
| | | | | | | This adds documentation for the Active Job API. It includes documentation on how to configure the queue_adapter, and how to create new jobs. It adds links to the various other sections of the Active Job documentation.
* [ci skip] AJ docs fixesAkshay Vishnoi2014-09-181-1/+1
| | | | | | | | 1. Indentation 2. Spaces issues 3. Spelling correction 4. Grammar correction 5. Add #:nodoc: to all internal classes
* Move variable assignment within logging block.Guo Xiang Tan2014-09-051-8/+16
|
* Active Job refactoringCristian Bica2014-09-031-12/+16
|
* Pass logging message through block.Guo Xiang Tan2014-08-221-4/+4
| | | | This follows the good practice listed on http://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance
* [ActiveJob] require files in logging.rbAbdelkader Boudih2014-08-171-0/+2
|
* Added ActionMailer::DeliverLaterAbdelkader Boudih2014-08-131-2/+2
|
* Add 'activejob/' from commit '14f74a8331f94150dfee653224de8fc837797709'Abdelkader Boudih2014-08-121-0/+88
git-subtree-dir: activejob git-subtree-mainline: b45b99894a60eda434abec94d133a1cfd8de2dda git-subtree-split: 14f74a8331f94150dfee653224de8fc837797709