fix(core): update

This commit is contained in:
2021-07-07 00:47:45 +02:00
parent 540e5be2fa
commit e451c38f32
4 changed files with 22397 additions and 1017 deletions

View File

@ -41,8 +41,9 @@ export class LogAggregator {
private async sendAggregatedLogs(logCandidate: ILogCandidate) {
this.logObjectMap.remove(logCandidate);
// lets post the message to logdna
const url = `${this.baseUrl}${logCandidate.urlIdentifier}&now=${Date.now()}`;
const response = await plugins.smartrequest.postJson(
`${this.baseUrl}${logCandidate.urlIdentifier}&now=${Date.now()}`,
url,
{
headers: {
Authorization: this.createBasicAuth(),

View File

@ -31,11 +31,16 @@ export class LogdnaAccount {
const uriIp = euc(lm.options.ip);
const uriTags = euc(
(() => {
let first = true;
return lm.options.tags.reduce((reduced, newItem) => {
return `${reduced},${newItem}`;
if (first) {
first = false;
reduced = euc(reduced);
}
return `${reduced},euc(${newItem})`;
});
})()
);
)
// let construct the request uri
const requestUrlWithParams = `?hostname=${uriHostname}&mac=${uriMac}&ip=1${uriIp}&tags=${uriTags}`;
@ -64,7 +69,7 @@ export class LogdnaAccount {
*/
public get smartlogDestination(): ILogDestination {
return {
handleLog: logPackageArg => {
handleLog: async logPackageArg => {
this.sendSmartlogPackage(logPackageArg);
}
};