Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
5f94db8d5d | |||
f9866076ca | |||
aa43a221a0 | |||
cb63b305ad | |||
6fde0544f5 | |||
6ed2b6e993 | |||
4f1df305ed | |||
44fccc252e | |||
0854207a04 | |||
64b71dfb42 | |||
d846b100d2 |
31
dist/elasticlog.classes.elasticlog.d.ts
vendored
31
dist/elasticlog.classes.elasticlog.d.ts
vendored
@ -1,31 +0,0 @@
|
|||||||
import { Client as ElasticClient } from 'elasticsearch';
|
|
||||||
import { ILogContext } from 'smartlog-interfaces';
|
|
||||||
import { LogScheduler } from './elasticlog.classes.logscheduler';
|
|
||||||
export interface IStandardLogParams {
|
|
||||||
message: string;
|
|
||||||
severity: string;
|
|
||||||
}
|
|
||||||
export interface IElasticLogConstructorOptions {
|
|
||||||
port: number;
|
|
||||||
domain: string;
|
|
||||||
ssl: boolean;
|
|
||||||
user?: string;
|
|
||||||
pass?: string;
|
|
||||||
logContext: ILogContext;
|
|
||||||
}
|
|
||||||
export declare class ElasticLog<T> {
|
|
||||||
client: ElasticClient;
|
|
||||||
logContext: ILogContext;
|
|
||||||
logScheduler: LogScheduler;
|
|
||||||
/**
|
|
||||||
* sets up an instance of Elastic log
|
|
||||||
* @param optionsArg
|
|
||||||
*/
|
|
||||||
constructor(optionsArg: IElasticLogConstructorOptions);
|
|
||||||
/**
|
|
||||||
* computes the host string from the constructor options
|
|
||||||
* @param optionsArg
|
|
||||||
*/
|
|
||||||
private computeHostString(optionsArg);
|
|
||||||
log(logObject: IStandardLogParams, scheduleOverwrite?: boolean): Promise<void>;
|
|
||||||
}
|
|
77
dist/elasticlog.classes.elasticlog.js
vendored
77
dist/elasticlog.classes.elasticlog.js
vendored
@ -1,77 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
// interfaces
|
|
||||||
const elasticsearch_1 = require("elasticsearch");
|
|
||||||
// other classes
|
|
||||||
const elasticlog_classes_logscheduler_1 = require("./elasticlog.classes.logscheduler");
|
|
||||||
class ElasticLog {
|
|
||||||
/**
|
|
||||||
* sets up an instance of Elastic log
|
|
||||||
* @param optionsArg
|
|
||||||
*/
|
|
||||||
constructor(optionsArg) {
|
|
||||||
this.logScheduler = new elasticlog_classes_logscheduler_1.LogScheduler(this);
|
|
||||||
this.logContext = optionsArg.logContext;
|
|
||||||
this.client = new elasticsearch_1.Client({
|
|
||||||
host: this.computeHostString(optionsArg),
|
|
||||||
log: 'trace'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* computes the host string from the constructor options
|
|
||||||
* @param optionsArg
|
|
||||||
*/
|
|
||||||
computeHostString(optionsArg) {
|
|
||||||
let hostString = `${optionsArg.domain}:${optionsArg.port}`;
|
|
||||||
if (optionsArg.user && optionsArg.pass) {
|
|
||||||
hostString = `${optionsArg.user}:${optionsArg.pass}@${hostString}`;
|
|
||||||
}
|
|
||||||
if (optionsArg.ssl) {
|
|
||||||
hostString = `https://${hostString}`;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
hostString = `http://${hostString}`;
|
|
||||||
}
|
|
||||||
return hostString;
|
|
||||||
}
|
|
||||||
log(logObject, scheduleOverwrite = false) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const now = new Date();
|
|
||||||
if (this.logScheduler.logsScheduled && !scheduleOverwrite) {
|
|
||||||
this.logScheduler.scheduleLog(logObject);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.client.index({
|
|
||||||
index: `logs-${now.getFullYear()}.${('0' + (now.getMonth() + 1)).slice(-2)}.${now.getDate()}`,
|
|
||||||
type: 'log',
|
|
||||||
body: {
|
|
||||||
'@timestamp': now.toISOString(),
|
|
||||||
zone: this.logContext.zone,
|
|
||||||
container: this.logContext.containerName,
|
|
||||||
environment: this.logContext.environment,
|
|
||||||
severity: logObject.severity,
|
|
||||||
message: logObject.message
|
|
||||||
}
|
|
||||||
}, (error, response) => {
|
|
||||||
if (error) {
|
|
||||||
console.log('ElasticLog encountered an error:');
|
|
||||||
console.log(error);
|
|
||||||
this.logScheduler.addFailedLog(logObject);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log(`ElasticLog: ${logObject.message}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.ElasticLog = ElasticLog;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWxhc3RpY2xvZy5jbGFzc2VzLmVsYXN0aWNsb2cuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9lbGFzdGljbG9nLmNsYXNzZXMuZWxhc3RpY2xvZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsYUFBYTtBQUNiLGlEQUF3RDtBQUd4RCxnQkFBZ0I7QUFDaEIsdUZBQWlFO0FBZ0JqRTtJQUtFOzs7T0FHRztJQUNILFlBQVksVUFBeUM7UUFOckQsaUJBQVksR0FBRyxJQUFJLDhDQUFZLENBQUMsSUFBSSxDQUFDLENBQUM7UUFPcEMsSUFBSSxDQUFDLFVBQVUsR0FBRyxVQUFVLENBQUMsVUFBVSxDQUFDO1FBQ3hDLElBQUksQ0FBQyxNQUFNLEdBQUcsSUFBSSxzQkFBYSxDQUFDO1lBQzlCLElBQUksRUFBRSxJQUFJLENBQUMsaUJBQWlCLENBQUMsVUFBVSxDQUFDO1lBQ3hDLEdBQUcsRUFBRSxPQUFPO1NBQ2IsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztJQUVEOzs7T0FHRztJQUNLLGlCQUFpQixDQUFDLFVBQXlDO1FBQ2pFLElBQUksVUFBVSxHQUFHLEdBQUcsVUFBVSxDQUFDLE1BQU0sSUFBSSxVQUFVLENBQUMsSUFBSSxFQUFFLENBQUM7UUFDM0QsRUFBRSxDQUFDLENBQUMsVUFBVSxDQUFDLElBQUksSUFBSSxVQUFVLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztZQUN2QyxVQUFVLEdBQUcsR0FBRyxVQUFVLENBQUMsSUFBSSxJQUFJLFVBQVUsQ0FBQyxJQUFJLElBQUksVUFBVSxFQUFFLENBQUM7UUFDckUsQ0FBQztRQUNELEVBQUUsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO1lBQ25CLFVBQVUsR0FBRyxXQUFXLFVBQVUsRUFBRSxDQUFDO1FBQ3ZDLENBQUM7UUFBQyxJQUFJLENBQUMsQ0FBQztZQUNOLFVBQVUsR0FBRyxVQUFVLFVBQVUsRUFBRSxDQUFDO1FBQ3RDLENBQUM7UUFDRCxNQUFNLENBQUMsVUFBVSxDQUFDO0lBQ3BCLENBQUM7SUFFSyxHQUFHLENBQUMsU0FBNkIsRUFBRSxpQkFBaUIsR0FBRyxLQUFLOztZQUNoRSxNQUFNLEdBQUcsR0FBRyxJQUFJLElBQUksRUFBRSxDQUFDO1lBQ3ZCLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsYUFBYSxJQUFJLENBQUMsaUJBQWlCLENBQUMsQ0FBQyxDQUFDO2dCQUMxRCxJQUFJLENBQUMsWUFBWSxDQUFDLFdBQVcsQ0FBQyxTQUFTLENBQUMsQ0FBQztnQkFDekMsTUFBTSxDQUFDO1lBQ1QsQ0FBQztZQUNELElBQUksQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUNmO2dCQUNFLEtBQUssRUFBRSxRQUFRLEdBQUcsQ0FBQyxXQUFXLEVBQUUsSUFBSSxDQUFDLEdBQUcsR0FBRyxDQUFDLEdBQUcsQ0FBQyxRQUFRLEVBQUUsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FDcEUsQ0FBQyxDQUFDLENBQ0gsSUFBSSxHQUFHLENBQUMsT0FBTyxFQUFFLEVBQUU7Z0JBQ3BCLElBQUksRUFBRSxLQUFLO2dCQUNYLElBQUksRUFBRTtvQkFDSixZQUFZLEVBQUUsR0FBRyxDQUFDLFdBQVcsRUFBRTtvQkFDL0IsSUFBSSxFQUFFLElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSTtvQkFDMUIsU0FBUyxFQUFFLElBQUksQ0FBQyxVQUFVLENBQUMsYUFBYTtvQkFDeEMsV0FBVyxFQUFFLElBQUksQ0FBQyxVQUFVLENBQUMsV0FBVztvQkFDeEMsUUFBUSxFQUFFLFNBQVMsQ0FBQyxRQUFRO29CQUM1QixPQUFPLEVBQUUsU0FBUyxDQUFDLE9BQU87aUJBQzNCO2FBQ0YsRUFDRCxDQUFDLEtBQUssRUFBRSxRQUFRLEVBQUUsRUFBRTtnQkFDbEIsRUFBRSxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQztvQkFDVixPQUFPLENBQUMsR0FBRyxDQUFDLGtDQUFrQyxDQUFDLENBQUM7b0JBQ2hELE9BQU8sQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUM7b0JBQ25CLElBQUksQ0FBQyxZQUFZLENBQUMsWUFBWSxDQUFDLFNBQVMsQ0FBQyxDQUFDO2dCQUM1QyxDQUFDO2dCQUFDLElBQUksQ0FBQyxDQUFDO29CQUNOLE9BQU8sQ0FBQyxHQUFHLENBQUMsZUFBZSxTQUFTLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FBQztnQkFDbEQsQ0FBQztZQUNILENBQUMsQ0FDRixDQUFDO1FBQ0osQ0FBQztLQUFBO0NBQ0Y7QUFsRUQsZ0NBa0VDIn0=
|
|
11
dist/elasticlog.classes.logscheduler.d.ts
vendored
11
dist/elasticlog.classes.logscheduler.d.ts
vendored
@ -1,11 +0,0 @@
|
|||||||
import { ElasticLog, IStandardLogParams } from './elasticlog.classes.elasticlog';
|
|
||||||
export declare class LogScheduler {
|
|
||||||
elasticLogRef: ElasticLog<any>;
|
|
||||||
logsScheduled: boolean;
|
|
||||||
logStorage: any[];
|
|
||||||
constructor(elasticLogRefArg: ElasticLog<any>);
|
|
||||||
addFailedLog(objectArg: any | IStandardLogParams): void;
|
|
||||||
scheduleLog(logObject: any): void;
|
|
||||||
setRetry(): void;
|
|
||||||
deferSend(): void;
|
|
||||||
}
|
|
42
dist/elasticlog.classes.logscheduler.js
vendored
42
dist/elasticlog.classes.logscheduler.js
vendored
@ -1,42 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
class LogScheduler {
|
|
||||||
constructor(elasticLogRefArg) {
|
|
||||||
this.logsScheduled = false;
|
|
||||||
this.logStorage = [];
|
|
||||||
this.elasticLogRef = elasticLogRefArg;
|
|
||||||
}
|
|
||||||
addFailedLog(objectArg) {
|
|
||||||
this.logStorage.push(objectArg);
|
|
||||||
this.setRetry();
|
|
||||||
}
|
|
||||||
scheduleLog(logObject) {
|
|
||||||
this.logStorage.push(logObject);
|
|
||||||
}
|
|
||||||
setRetry() {
|
|
||||||
setTimeout(() => {
|
|
||||||
const oldStorage = this.logStorage;
|
|
||||||
this.logStorage = [];
|
|
||||||
for (let logObject of oldStorage) {
|
|
||||||
this.elasticLogRef.log(logObject, true);
|
|
||||||
}
|
|
||||||
if (this.logStorage.length === 0) {
|
|
||||||
console.log('ElasticLog retry success!!!');
|
|
||||||
this.logsScheduled = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log('ElasticLog retry failed');
|
|
||||||
this.setRetry();
|
|
||||||
}
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
deferSend() {
|
|
||||||
if (!this.logsScheduled) {
|
|
||||||
console.log('Retry ElasticLog in 5 seconds!');
|
|
||||||
this.logsScheduled = true;
|
|
||||||
this.setRetry();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.LogScheduler = LogScheduler;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWxhc3RpY2xvZy5jbGFzc2VzLmxvZ3NjaGVkdWxlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2VsYXN0aWNsb2cuY2xhc3Nlcy5sb2dzY2hlZHVsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFQTtJQUtFLFlBQVksZ0JBQWlDO1FBSDdDLGtCQUFhLEdBQUcsS0FBSyxDQUFDO1FBQ3RCLGVBQVUsR0FBVSxFQUFFLENBQUM7UUFHckIsSUFBSSxDQUFDLGFBQWEsR0FBRyxnQkFBZ0IsQ0FBQztJQUN4QyxDQUFDO0lBRUQsWUFBWSxDQUFDLFNBQW1DO1FBQzlDLElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQ2hDLElBQUksQ0FBQyxRQUFRLEVBQUUsQ0FBQztJQUNsQixDQUFDO0lBQ0QsV0FBVyxDQUFDLFNBQWM7UUFDeEIsSUFBSSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUM7SUFDbEMsQ0FBQztJQUVELFFBQVE7UUFDTixVQUFVLENBQUMsR0FBRyxFQUFFO1lBQ2QsTUFBTSxVQUFVLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQztZQUNuQyxJQUFJLENBQUMsVUFBVSxHQUFHLEVBQUUsQ0FBQztZQUNyQixHQUFHLENBQUMsQ0FBQyxJQUFJLFNBQVMsSUFBSSxVQUFVLENBQUMsQ0FBQyxDQUFDO2dCQUNqQyxJQUFJLENBQUMsYUFBYSxDQUFDLEdBQUcsQ0FBQyxTQUFTLEVBQUUsSUFBSSxDQUFDLENBQUM7WUFDMUMsQ0FBQztZQUNELEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsTUFBTSxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUM7Z0JBQ2pDLE9BQU8sQ0FBQyxHQUFHLENBQUMsNkJBQTZCLENBQUMsQ0FBQztnQkFDM0MsSUFBSSxDQUFDLGFBQWEsR0FBRyxLQUFLLENBQUM7WUFDN0IsQ0FBQztZQUFDLElBQUksQ0FBQyxDQUFDO2dCQUNOLE9BQU8sQ0FBQyxHQUFHLENBQUMseUJBQXlCLENBQUMsQ0FBQztnQkFDdkMsSUFBSSxDQUFDLFFBQVEsRUFBRSxDQUFDO1lBQ2xCLENBQUM7UUFDSCxDQUFDLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDWCxDQUFDO0lBRUQsU0FBUztRQUNQLEVBQUUsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLGFBQWEsQ0FBQyxDQUFDLENBQUM7WUFDeEIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxnQ0FBZ0MsQ0FBQyxDQUFDO1lBQzlDLElBQUksQ0FBQyxhQUFhLEdBQUcsSUFBSSxDQUFDO1lBQzFCLElBQUksQ0FBQyxRQUFRLEVBQUUsQ0FBQztRQUNsQixDQUFDO0lBQ0gsQ0FBQztDQUNGO0FBekNELG9DQXlDQyJ9
|
|
4
dist/elasticlog.plugins.d.ts
vendored
4
dist/elasticlog.plugins.d.ts
vendored
@ -1,4 +0,0 @@
|
|||||||
import * as elasticsearch from 'elasticsearch';
|
|
||||||
import * as smartdelay from 'smartdelay';
|
|
||||||
import * as smartlogInterfaces from 'smartlog-interfaces';
|
|
||||||
export { elasticsearch, smartdelay, smartlogInterfaces };
|
|
9
dist/elasticlog.plugins.js
vendored
9
dist/elasticlog.plugins.js
vendored
@ -1,9 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const elasticsearch = require("elasticsearch");
|
|
||||||
exports.elasticsearch = elasticsearch;
|
|
||||||
const smartdelay = require("smartdelay");
|
|
||||||
exports.smartdelay = smartdelay;
|
|
||||||
const smartlogInterfaces = require("smartlog-interfaces");
|
|
||||||
exports.smartlogInterfaces = smartlogInterfaces;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWxhc3RpY2xvZy5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvZWxhc3RpY2xvZy5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsK0NBQStDO0FBR3RDLHNDQUFhO0FBRnRCLHlDQUF5QztBQUVqQixnQ0FBVTtBQURsQywwREFBMEQ7QUFDdEIsZ0RBQWtCIn0=
|
|
1
dist/index.d.ts
vendored
1
dist/index.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export * from './elasticlog.classes.elasticlog';
|
|
7
dist/index.js
vendored
7
dist/index.js
vendored
@ -1,7 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function __export(m) {
|
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
||||||
}
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
__export(require("./elasticlog.classes.elasticlog"));
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHFEQUFnRCJ9
|
|
54
package-lock.json
generated
54
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/elasticlog",
|
"name": "@mojoio/elasticsearch",
|
||||||
"version": "1.0.14",
|
"version": "1.0.20",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -74,6 +74,19 @@
|
|||||||
"@pushrocks/smartpromise": "^2.0.5"
|
"@pushrocks/smartpromise": "^2.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@pushrocks/lik": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@pushrocks/lik/-/lik-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-6dwRg7WMdY9drlqfo6NzOcw5ubVWYvIOSSMZz4Jsojpa8aDVwXd2VkD7sxO/PJRrbZzHkx/JXoY/epcWRjngUw==",
|
||||||
|
"requires": {
|
||||||
|
"@pushrocks/smartpromise": "^2.0.5",
|
||||||
|
"@types/lodash": "^4.14.112",
|
||||||
|
"@types/minimatch": "^3.0.3",
|
||||||
|
"lodash": "^4.17.10",
|
||||||
|
"minimatch": "^3.0.4",
|
||||||
|
"symbol-tree": "^3.2.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@pushrocks/qenv": {
|
"@pushrocks/qenv": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@pushrocks/qenv/-/qenv-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@pushrocks/qenv/-/qenv-2.0.2.tgz",
|
||||||
@ -137,12 +150,20 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartlog-interfaces": "^1.0.9"
|
"@pushrocks/smartlog-interfaces": "^1.0.9"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@pushrocks/smartlog-interfaces": {
|
||||||
|
"version": "1.0.15",
|
||||||
|
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-1.0.15.tgz",
|
||||||
|
"integrity": "sha512-dn9a+IhneukhtVGQG031oodOITmmQ5s5hcMThd+cMUQL3XYTbLPnZVuJfTDeWCT0iqLqrBD/qp2d1RRc3W/qIQ==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smartlog-interfaces": {
|
"@pushrocks/smartlog-interfaces": {
|
||||||
"version": "1.0.15",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-1.0.15.tgz",
|
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-2.0.2.tgz",
|
||||||
"integrity": "sha512-dn9a+IhneukhtVGQG031oodOITmmQ5s5hcMThd+cMUQL3XYTbLPnZVuJfTDeWCT0iqLqrBD/qp2d1RRc3W/qIQ=="
|
"integrity": "sha512-kJNQ/6kfljgtwebhoiD8WtRWfdVhOoE1nr8FoUJLlOjLphU8SPa42Hg6/yPkSTaGxWwDhk6PkMJl64O7HNjRUQ=="
|
||||||
},
|
},
|
||||||
"@pushrocks/smartpath": {
|
"@pushrocks/smartpath": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
@ -234,6 +255,16 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/lodash": {
|
||||||
|
"version": "4.14.118",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.118.tgz",
|
||||||
|
"integrity": "sha512-iiJbKLZbhSa6FYRip/9ZDX6HXhayXLDGY2Fqws9cOkEQ6XeKfaxB0sC541mowZJueYyMnVUmmG+al5/4fCDrgw=="
|
||||||
|
},
|
||||||
|
"@types/minimatch": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
||||||
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "10.12.2",
|
"version": "10.12.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.2.tgz",
|
||||||
@ -320,8 +351,7 @@
|
|||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"bindings": {
|
"bindings": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
@ -333,7 +363,6 @@
|
|||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^1.0.0",
|
||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
@ -460,8 +489,7 @@
|
|||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
@ -714,7 +742,6 @@
|
|||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
@ -932,6 +959,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
||||||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
|
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
|
||||||
},
|
},
|
||||||
|
"symbol-tree": {
|
||||||
|
"version": "3.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz",
|
||||||
|
"integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY="
|
||||||
|
},
|
||||||
"ts-node": {
|
"ts-node": {
|
||||||
"version": "7.0.1",
|
"version": "7.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz",
|
||||||
|
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/elasticlog",
|
"name": "@mojoio/elasticsearch",
|
||||||
"version": "1.0.14",
|
"version": "1.0.20",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "log to elasticsearch in a kibana compatible format",
|
"description": "log to elasticsearch in a kibana compatible format",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -10,7 +10,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"format": "(gitzone format)",
|
"format": "(gitzone format)",
|
||||||
"build": "echo \"Not needed for now\""
|
"build": "(tsbuild)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.0.22",
|
||||||
@ -23,8 +23,10 @@
|
|||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@pushrocks/lik": "^3.0.1",
|
||||||
"@pushrocks/smartdelay": "^2.0.2",
|
"@pushrocks/smartdelay": "^2.0.2",
|
||||||
"@pushrocks/smartlog-interfaces": "^1.0.15",
|
"@pushrocks/smartlog-interfaces": "^2.0.2",
|
||||||
|
"@pushrocks/smartpromise": "^2.0.5",
|
||||||
"@types/elasticsearch": "^5.0.28",
|
"@types/elasticsearch": "^5.0.28",
|
||||||
"elasticsearch": "^15.2.0"
|
"elasticsearch": "^15.2.0"
|
||||||
}
|
}
|
||||||
|
28
test/test.ts
28
test/test.ts
@ -1,31 +1,35 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, tap } from '@pushrocks/tapbundle';
|
||||||
import { Qenv } from '@pushrocks/qenv';
|
import { Qenv } from '@pushrocks/qenv';
|
||||||
import * as elasticlog from '../ts/index';
|
import * as elasticsearch from '../ts/index';
|
||||||
|
|
||||||
const testQenv = new Qenv('./', './.nogit/');
|
const testQenv = new Qenv('./', './.nogit/');
|
||||||
|
|
||||||
let testElasticLog: elasticlog.ElasticLog<any>;
|
let testElasticLog: elasticsearch.ElasticSearch<any>;
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
tap.test('first test', async () => {
|
||||||
testElasticLog = new elasticlog.ElasticLog({
|
testElasticLog = new elasticsearch.ElasticSearch({
|
||||||
domain: process.env.ELK_DOMAIN,
|
domain: process.env.ELK_DOMAIN,
|
||||||
port: parseInt(process.env.ELK_PORT, 10),
|
port: parseInt(process.env.ELK_PORT, 10),
|
||||||
ssl: true,
|
ssl: true,
|
||||||
user: process.env.ELK_USER,
|
user: process.env.ELK_USER,
|
||||||
pass: process.env.ELK_PASS,
|
pass: process.env.ELK_PASS
|
||||||
logContext: {
|
|
||||||
company: 'Lossless GmbH',
|
|
||||||
runtime: 'node',
|
|
||||||
containerName: 'testContainer',
|
|
||||||
environment: 'test'
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
expect(testElasticLog).to.be.instanceOf(elasticlog.ElasticLog);
|
expect(testElasticLog).to.be.instanceOf(elasticsearch.ElasticSearch);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should send a message to Elasticsearch', async () => {
|
tap.test('should send a message to Elasticsearch', async () => {
|
||||||
testElasticLog.log({
|
testElasticLog.log({
|
||||||
severity: 'log',
|
timestamp: Date.now(),
|
||||||
|
type: 'increment',
|
||||||
|
level: 'info',
|
||||||
|
context: {
|
||||||
|
company: 'Lossless GmbH',
|
||||||
|
companyunit: 'lossless.cloud',
|
||||||
|
containerName: 'testcontainer',
|
||||||
|
environment: 'test',
|
||||||
|
runtime: 'node',
|
||||||
|
zone: 'ship.zone'
|
||||||
|
},
|
||||||
message: 'hi, this is a testMessage'
|
message: 'hi, this is a testMessage'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
import { ElasticLog, IStandardLogParams } from './elasticlog.classes.elasticlog';
|
|
||||||
|
|
||||||
export class LogScheduler {
|
|
||||||
elasticLogRef: ElasticLog<any>;
|
|
||||||
logsScheduled = false;
|
|
||||||
logStorage: any[] = [];
|
|
||||||
|
|
||||||
constructor(elasticLogRefArg: ElasticLog<any>) {
|
|
||||||
this.elasticLogRef = elasticLogRefArg;
|
|
||||||
}
|
|
||||||
|
|
||||||
addFailedLog(objectArg: any | IStandardLogParams) {
|
|
||||||
this.logStorage.push(objectArg);
|
|
||||||
this.setRetry();
|
|
||||||
}
|
|
||||||
scheduleLog(logObject: any) {
|
|
||||||
this.logStorage.push(logObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
setRetry() {
|
|
||||||
setTimeout(() => {
|
|
||||||
const oldStorage = this.logStorage;
|
|
||||||
this.logStorage = [];
|
|
||||||
for (let logObject of oldStorage) {
|
|
||||||
this.elasticLogRef.log(logObject, true);
|
|
||||||
}
|
|
||||||
if (this.logStorage.length === 0) {
|
|
||||||
console.log('ElasticLog retry success!!!');
|
|
||||||
this.logsScheduled = false;
|
|
||||||
} else {
|
|
||||||
console.log('ElasticLog retry failed');
|
|
||||||
this.setRetry();
|
|
||||||
}
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
|
|
||||||
deferSend() {
|
|
||||||
if (!this.logsScheduled) {
|
|
||||||
console.log('Retry ElasticLog in 5 seconds!');
|
|
||||||
this.logsScheduled = true;
|
|
||||||
this.setRetry();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
45
ts/elasticsearch.classes.elasticindex.ts
Normal file
45
ts/elasticsearch.classes.elasticindex.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import * as plugins from './elasticsearch.plugins';
|
||||||
|
import { ElasticSearch } from './elasticsearch.classes.elasticsearch';
|
||||||
|
import { ILogPackage } from '@pushrocks/smartlog-interfaces';
|
||||||
|
|
||||||
|
import { Stringmap } from '@pushrocks/lik';
|
||||||
|
|
||||||
|
export class ElasticIndex {
|
||||||
|
private stringmap = new Stringmap();
|
||||||
|
private elasticSearchRef: ElasticSearch<any>;
|
||||||
|
|
||||||
|
constructor(elasticSearchInstanceArg: ElasticSearch<ILogPackage>) {
|
||||||
|
this.elasticSearchRef = elasticSearchInstanceArg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async ensureIndex(indexArg: string) {
|
||||||
|
const done = plugins.smartpromise.defer();
|
||||||
|
if(this.stringmap.checkString(indexArg)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.elasticSearchRef.client.cat.indices({
|
||||||
|
format: 'json',
|
||||||
|
bytes: 'm'
|
||||||
|
}, async (err, response: any[]) => {
|
||||||
|
// console.log(response);
|
||||||
|
const index = response.find(indexObject => {
|
||||||
|
return indexObject.index === indexArg;
|
||||||
|
});
|
||||||
|
|
||||||
|
if(!index) {
|
||||||
|
const done2 = plugins.smartpromise.defer();
|
||||||
|
this.elasticSearchRef.client.indices.create({
|
||||||
|
waitForActiveShards: '2',
|
||||||
|
index: indexArg
|
||||||
|
}, (error, response) => {
|
||||||
|
// console.lof(response)
|
||||||
|
done2.resolve();
|
||||||
|
});
|
||||||
|
await done2.promise;
|
||||||
|
}
|
||||||
|
this.stringmap.addString(indexArg);
|
||||||
|
done.resolve();
|
||||||
|
});
|
||||||
|
await done.promise;
|
||||||
|
}
|
||||||
|
}
|
44
ts/elasticsearch.classes.elasticscheduler.ts
Normal file
44
ts/elasticsearch.classes.elasticscheduler.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import { ElasticSearch, IStandardLogParams } from './elasticsearch.classes.elasticsearch';
|
||||||
|
|
||||||
|
export class ElasticScheduler {
|
||||||
|
elasticSearchRef: ElasticSearch<any>;
|
||||||
|
docsScheduled = false;
|
||||||
|
docsStorage: any[] = [];
|
||||||
|
|
||||||
|
constructor(elasticLogRefArg: ElasticSearch<any>) {
|
||||||
|
this.elasticSearchRef = elasticLogRefArg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public addFailedDoc(objectArg: any | IStandardLogParams) {
|
||||||
|
this.docsStorage.push(objectArg);
|
||||||
|
this.setRetry();
|
||||||
|
}
|
||||||
|
public scheduleDoc(logObject: any) {
|
||||||
|
this.docsStorage.push(logObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public setRetry() {
|
||||||
|
setTimeout(() => {
|
||||||
|
const oldStorage = this.docsStorage;
|
||||||
|
this.docsStorage = [];
|
||||||
|
for (let logObject of oldStorage) {
|
||||||
|
this.elasticSearchRef.log(logObject, true);
|
||||||
|
}
|
||||||
|
if (this.docsStorage.length === 0) {
|
||||||
|
console.log('ElasticLog retry success!!!');
|
||||||
|
this.docsScheduled = false;
|
||||||
|
} else {
|
||||||
|
console.log('ElasticLog retry failed');
|
||||||
|
this.setRetry();
|
||||||
|
}
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public deferSend() {
|
||||||
|
if (!this.docsScheduled) {
|
||||||
|
console.log('Retry ElasticLog in 5 seconds!');
|
||||||
|
this.docsScheduled = true;
|
||||||
|
this.setRetry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,10 @@
|
|||||||
// interfaces
|
// interfaces
|
||||||
import { Client as ElasticClient } from 'elasticsearch';
|
import { Client as ElasticClient } from 'elasticsearch';
|
||||||
import { ILogContext } from '@pushrocks/smartlog-interfaces';
|
import { ILogContext, ILogPackage, ILogDestination } from '@pushrocks/smartlog-interfaces';
|
||||||
|
|
||||||
// other classes
|
// other classes
|
||||||
import { LogScheduler } from './elasticlog.classes.logscheduler';
|
import { ElasticScheduler } from './elasticsearch.classes.elasticscheduler';
|
||||||
|
import { ElasticIndex } from './elasticsearch.classes.elasticindex';
|
||||||
|
|
||||||
export interface IStandardLogParams {
|
export interface IStandardLogParams {
|
||||||
message: string;
|
message: string;
|
||||||
@ -16,20 +17,18 @@ export interface IElasticLogConstructorOptions {
|
|||||||
ssl: boolean;
|
ssl: boolean;
|
||||||
user?: string;
|
user?: string;
|
||||||
pass?: string;
|
pass?: string;
|
||||||
logContext: ILogContext;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ElasticLog<T> {
|
export class ElasticSearch<T> {
|
||||||
client: ElasticClient;
|
public client: ElasticClient;
|
||||||
logContext: ILogContext;
|
public elasticScheduler = new ElasticScheduler(this);
|
||||||
logScheduler = new LogScheduler(this);
|
public elasticIndex: ElasticIndex = new ElasticIndex(this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sets up an instance of Elastic log
|
* sets up an instance of Elastic log
|
||||||
* @param optionsArg
|
* @param optionsArg
|
||||||
*/
|
*/
|
||||||
constructor(optionsArg: IElasticLogConstructorOptions) {
|
constructor(optionsArg: IElasticLogConstructorOptions) {
|
||||||
this.logContext = optionsArg.logContext;
|
|
||||||
this.client = new ElasticClient({
|
this.client = new ElasticClient({
|
||||||
host: this.computeHostString(optionsArg),
|
host: this.computeHostString(optionsArg),
|
||||||
log: 'trace'
|
log: 'trace'
|
||||||
@ -53,36 +52,46 @@ export class ElasticLog<T> {
|
|||||||
return hostString;
|
return hostString;
|
||||||
}
|
}
|
||||||
|
|
||||||
async log(logObject: IStandardLogParams, scheduleOverwrite = false) {
|
public async log(logPackageArg: ILogPackage, scheduleOverwrite = false) {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
if (this.logScheduler.logsScheduled && !scheduleOverwrite) {
|
const indexToUse = `smartlog-${now.getFullYear()}.${('0' + (now.getMonth() + 1)).slice(-2)}.${(
|
||||||
this.logScheduler.scheduleLog(logObject);
|
'0' + now.getDate()
|
||||||
|
).slice(-2)}`;
|
||||||
|
|
||||||
|
|
||||||
|
if (this.elasticScheduler.docsScheduled && !scheduleOverwrite) {
|
||||||
|
this.elasticScheduler.scheduleDoc(logPackageArg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await this.elasticIndex.ensureIndex(indexToUse);
|
||||||
|
|
||||||
this.client.index(
|
this.client.index(
|
||||||
{
|
{
|
||||||
index: `logstash-${now.getFullYear()}.${('0' + (now.getMonth() + 1)).slice(-2)}.${(
|
index: indexToUse,
|
||||||
'0' + now.getDate()
|
|
||||||
).slice(-2)}`,
|
|
||||||
type: 'log',
|
type: 'log',
|
||||||
body: {
|
body: {
|
||||||
'@timestamp': now.toISOString(),
|
'@timestamp': new Date(logPackageArg.timestamp).toISOString(),
|
||||||
zone: this.logContext.zone,
|
...logPackageArg
|
||||||
container: this.logContext.containerName,
|
|
||||||
environment: this.logContext.environment,
|
|
||||||
severity: logObject.severity,
|
|
||||||
message: logObject.message
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(error, response) => {
|
(error, response) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.log('ElasticLog encountered an error:');
|
console.log('ElasticLog encountered an error:');
|
||||||
console.log(error);
|
console.log(error);
|
||||||
this.logScheduler.addFailedLog(logObject);
|
this.elasticScheduler.addFailedDoc(logPackageArg);
|
||||||
} else {
|
} else {
|
||||||
console.log(`ElasticLog: ${logObject.message}`);
|
console.log(`ElasticLog: ${logPackageArg.message}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get logDestination (): ILogDestination {
|
||||||
|
return {
|
||||||
|
handleLog: (smartlogPackageArg: ILogPackage) => {
|
||||||
|
this.log(smartlogPackageArg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,4 +1,6 @@
|
|||||||
import * as elasticsearch from 'elasticsearch';
|
import * as elasticsearch from 'elasticsearch';
|
||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
import * as smartlogInterfaces from '@pushrocks/smartlog-interfaces';
|
import * as smartlogInterfaces from '@pushrocks/smartlog-interfaces';
|
||||||
export { elasticsearch, smartdelay, smartlogInterfaces };
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
|
|
||||||
|
export { elasticsearch, smartdelay, smartlogInterfaces, smartpromise };
|
@ -1 +1 @@
|
|||||||
export * from './elasticlog.classes.elasticlog';
|
export * from './elasticsearch.classes.elasticsearch';
|
||||||
|
Reference in New Issue
Block a user