1
0
mirror of https://github.com/beestat/app.git synced 2026-05-13 10:52:29 -04:00

Updating logger to support the use of retention policies

Also having the ecobee logger use it
This commit is contained in:
Jon Ziebell
2019-08-10 07:23:02 -04:00
parent b816715612
commit 09f6b1c728
3 changed files with 14 additions and 2 deletions
+8 -1
View File
@@ -22,6 +22,12 @@ class external_api extends cora\api {
*/
protected static $log_mysql = 'error';
/**
* Default retention policy when inserting data. Autogen is the default
* infinite one; also available is 30d.
*/
protected static $influx_retention_policy = 'autogen';
/**
* Whether or not to cache API calls. This will store a hash of the request
* and the response in the database and check there before performing the
@@ -230,7 +236,8 @@ class external_api extends cora\api {
'http_code' => (int) $this->curl_info['http_code'],
'connect_time' => round($this->curl_info['connect_time'], 4)
],
'timestamp' => $this->request_timestamp_microtime
'timestamp' => $this->request_timestamp_microtime,
'retention_policy' => $this::$influx_retention_policy
]
);
}