Compare commits

...

12 Commits

Author SHA1 Message Date
faf736f353 1.0.36 2021-07-07 00:50:46 +02:00
dca54899bf fix(core): update 2021-07-07 00:50:45 +02:00
7dac427f00 1.0.35 2021-07-07 00:47:45 +02:00
e451c38f32 fix(core): update 2021-07-07 00:47:45 +02:00
540e5be2fa 1.0.34 2020-06-10 08:46:45 +00:00
7d29f88356 fix(core): update 2020-06-10 08:46:44 +00:00
9d81f059fe 1.0.33 2020-06-05 16:06:54 +00:00
52cdf6f9fe fix(core): update 2020-06-05 16:06:52 +00:00
1339db1adf 1.0.32 2020-06-03 09:22:44 +00:00
2b42bd59c5 fix(core): update 2020-06-03 09:22:43 +00:00
4cd9ce8510 1.0.31 2020-06-03 09:18:07 +00:00
cf2620bd41 fix(core): update 2020-06-03 09:18:06 +00:00
7 changed files with 22420 additions and 1033 deletions

View File

@ -54,17 +54,6 @@ testStable:
- docker
- priv
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- windows
testBuild:
stage: test
script:

23382
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@mojoio/logdna",
"version": "1.0.30",
"version": "1.0.36",
"private": false,
"description": "an unoffical package for the logdna api",
"main": "dist_ts/index.js",
@ -13,20 +13,20 @@
"format": "(gitzone format)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.24",
"@gitzone/tstest": "^1.0.33",
"@pushrocks/qenv": "^4.0.6",
"@pushrocks/tapbundle": "^3.2.1",
"@types/node": "^14.0.9",
"tslint": "^6.1.2",
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tstest": "^1.0.54",
"@pushrocks/qenv": "^4.0.10",
"@pushrocks/tapbundle": "^3.2.14",
"@types/node": "^14.0.11",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@pushrocks/lik": "^4.0.13",
"@pushrocks/smartlog-interfaces": "^2.0.9",
"@pushrocks/smartrequest": "^1.1.47",
"@pushrocks/smartstring": "^3.0.18",
"@pushrocks/taskbuffer": "^2.1.1"
"@pushrocks/lik": "^4.0.20",
"@pushrocks/smartlog-interfaces": "^2.0.22",
"@pushrocks/smartrequest": "^1.1.52",
"@pushrocks/smartstring": "^3.0.24",
"@pushrocks/taskbuffer": "^2.1.13"
},
"files": [
"ts/**/*",

View File

@ -26,6 +26,10 @@ tap.test('should create a standard log message', async () => {
runtime: 'node',
zone: 'shipzone'
},
correlation: {
id: '123',
type: 'none'
},
message: 'this is an awesome log message sent by the tapbundle test'
});
});
@ -49,7 +53,11 @@ tap.test('should send in order', async () => {
runtime: 'node',
zone: 'shipzone'
},
message: `this is an awesome log message sent by the tapbundle test #${i}`
message: `this is an awesome log message sent by the tapbundle test #${i}`,
correlation: {
id: '123',
type: 'none'
}
};
testLogDnaAccount.sendSmartlogPackage(testSmartlogMessage);
i++;
@ -67,6 +75,10 @@ tap.test('should send in order', async () => {
runtime: 'node',
zone: 'shipzone'
},
correlation: {
id: '123',
type: 'none'
},
message: `this is an awesome log message sent by the tapbundle test #${i}`
};
testLogDnaAccount.sendSmartlogPackage(testSmartlogMessage2);
@ -83,6 +95,10 @@ tap.test('should send in order', async () => {
runtime: 'node',
zone: 'shipzone'
},
correlation: {
id: '123',
type: 'none'
},
message: `this is an awesome log message sent by the tapbundle test #${i}`
};
testLogDnaAccount.sendSmartlogPackage(testSmartlogMessage3);

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

@ -71,7 +71,9 @@ export class LogdnaMessage {
line: smartlogPackageArg.message,
meta: {
...smartlogPackageArg.context,
logType: smartlogPackageArg.type
logType: smartlogPackageArg.type,
correlation: smartlogPackageArg.correlation,
data: smartlogPackageArg.data || {}
},
env: smartlogPackageArg.context.environment,
hostname: smartlogPackageArg.context.zone,

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);
}
};