feat(core): update index generation

This commit is contained in:
2018-01-26 02:00:01 +01:00
parent bc5c461b58
commit 9cf78e65ac
7 changed files with 47 additions and 11 deletions

View File

@ -62,7 +62,7 @@ export class ElasticLog<T> {
log(logObject: IStandardLogParams) {
const now = new Date()
this.client.index({
index: `logs-${now.getFullYear()}.${now.getMonth() + 1}.${now.getDate()}`,
index: `logs-${now.getFullYear()}.${("0" + (now.getMonth() + 1)).slice(-2)}.${now.getDate()}`,
type: 'log',
body: {
'@timestamp': now.toISOString(),

View File

@ -1,4 +1,6 @@
const removeme = {};
import * as elasticsearch from 'elasticsearch';
import * as smartdelay from 'smartdelay';
export {
removeme
elasticsearch,
smartdelay
}