Problem/Motivation

In some watchdog sensors the timestamp is missing.

Proposed resolution

So we have to readd the timestamp.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

edurenye created an issue. See original summary.

miro_dietiker’s picture

Strangely the watchdog sensor has special treatment to convert the timestamp from the epoch seconds to a readable format...
But it seems when we did the most recent refactoring, we accidentally dropped force adding the timestamp column...

Anyway, that's supposed to happen in config since it's a visible column.
In contrast to other columns that are force added by code and then not displayed at all. These should not be added by config at all IMHO.
We should check all sensors of Watchdog and unify the verbose columns as much it makes sense.

Followup: We also looked at a DatabaseAggregator that also had a timestamp added where the output is not converted at all...
Dunno how we can make sure we take care of the format / visual conversion for regular columns. For now our config schema does not support it.

miro_dietiker’s picture

Status: Active » Needs review
StatusFileSize
new7.23 KB

Trying some first cleanup...

(Additionally improved some comments / code sequence in the watchdog code where the timestamp handling takes place.)

Status: Needs review » Needs work

The last submitted patch, 3: monitoring_2601424_timestamp.patch, failed testing.

miro_dietiker’s picture

Status: Needs work » Fixed

Aww, forgot to flip some columns. Fixed and committed. There's still a failing test from SearchAPI.

  • miro_dietiker committed b54938c on 8.x-1.x
    Issue #2601424 by miro_dietiker: Readd timestamp for all watchdog...
berdir’s picture

+++ b/src/Plugin/monitoring/SensorPlugin/WatchdogAggregatorSensorPlugin.php
@@ -42,14 +42,18 @@ class WatchdogAggregatorSensorPlugin extends DatabaseAggregatorSensorPlugin impl
+          $output['result']['#rows'][$delta]['timestamp'] = date("Y-m-d H:i:s", $row['timestamp']);

why hardcode this using raw php functions instead of using Drupal's format date API's (which can be translated and configured)?

Was there before as I see, can someone open a follow-up to improve that?

edurenye’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.