Currently the watchdog() function is logging events using REQUEST_TIME constant which is just $_SERVER['REQUEST_TIME']. This works fine in most cases but processes that take an extended period of time all get logged at the time the process began, and not when the event actually happened. For example when running data migration scripts that can take much longer to process all of the errors get logged at the time the process began. It seems that watchdog would be more accurate if it logged the time with time() instead.
Comment | File | Size | Author |
---|---|---|---|
#19 | watchdog-time.patch | 731 bytes | jbrown |
#12 | 1239410-12.patch | 667 bytes | swentel |
#8 | drupal-1239410-8.x.patch | 660 bytes | cangeceiro |
#5 | drupal-1239410-8.x.patch | 660 bytes | cangeceiro |
#3 | drupal-1239410-7.x.patch | 569 bytes | cangeceiro |
Comments
Comment #1
Andre-Bsame for d7, this causes unwanted issues with drupal queue and long running cronjobs. One could also log the REQUEST_TIME in an additional field, but from my point of view timestamp should contain the time the function has been called.
Comment #2
cangeceiro CreditAttribution: cangeceiro commentedattached is a patch for d8
Comment #3
cangeceiro CreditAttribution: cangeceiro commentedand a backport to d7
Comment #4
catchMakes sense, but we should add a comment so this doesn't get reverted again later.
Comment #5
cangeceiro CreditAttribution: cangeceiro commentedlike so?
Comment #6
cangeceiro CreditAttribution: cangeceiro commentedstatus change
Comment #8
cangeceiro CreditAttribution: cangeceiro commentedreroll of patch.
Comment #9
cangeceiro CreditAttribution: cangeceiro commentedComment #10
ramlev CreditAttribution: ramlev commentedTested an working.
Comment #11
catchThis comment doesn't confirm to the coding standards, it should be above the line and be a full sentence with a period at the end. See http://drupal.org/coding-standards
Comment #12
swentel CreditAttribution: swentel commentedMove the comment above the line.
Comment #14
swentel CreditAttribution: swentel commented#12: 1239410-12.patch queued for re-testing.
Comment #15
Andre-B#12: 1239410-12.patch queued for re-testing.
Comment #16
jbrown CreditAttribution: jbrown commented#12: 1239410-12.patch queued for re-testing.
Comment #17
jbrown CreditAttribution: jbrown commentedComment #18
webchickI think this makes sense, as a valid use of time(). Thanks!
Committed and pushed to 8.x. Probably makes sense to backport to 7.x, too.
Comment #19
jbrown CreditAttribution: jbrown commentedComment #20
jbrown CreditAttribution: jbrown commentedSame patch as D8.
Comment #21
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/c987bbd