Compare commits

..

4 Commits

Author SHA1 Message Date
99bfc485cf 1.0.6 2018-11-03 16:22:32 +01:00
a55311c0fd fix(structure): format 2018-11-03 16:22:32 +01:00
7a45f829fc 1.0.5 2018-11-03 14:17:30 +01:00
d95d2705b0 fix(core): update 2018-11-03 14:17:29 +01:00
8 changed files with 11 additions and 34 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@mojoio/logdna", "name": "@mojoio/logdna",
"version": "1.0.4", "version": "1.0.6",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@mojoio/logdna", "name": "@mojoio/logdna",
"version": "1.0.4", "version": "1.0.6",
"private": false, "private": false,
"description": "anunoffical package for the logdna api", "description": "anunoffical package for the logdna api",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -29,6 +29,6 @@ tap.test('should create a standard log message', async () => {
tap.test('should send the message', async () => { tap.test('should send the message', async () => {
await testLogDnaAccount.sendLogDnaMessage(testLogMessage); await testLogDnaAccount.sendLogDnaMessage(testLogMessage);
}) });
tap.start(); tap.start();

View File

@ -1,2 +1,2 @@
export * from './logdna.logdnaaccount'; export * from './logdna.logdnaaccount';
export * from './logdna.classes.logmessage'; export * from './logdna.classes.logmessage';

View File

@ -22,7 +22,7 @@ export interface ILogdnaMessageContructorOptions {
ip: string; ip: string;
/** /**
* a text message, that is the core part * a text message, that is the core part
*/ */
line: string; line: string;
@ -60,7 +60,7 @@ export class LogdnaMessage {
* create lgdna messages from smartlog package * create lgdna messages from smartlog package
* @param smartlogPackageArg * @param smartlogPackageArg
*/ */
static fromSmartLogPackage (smartlogPackageArg: ILogPackage): LogdnaMessage { static fromSmartLogPackage(smartlogPackageArg: ILogPackage): LogdnaMessage {
return new LogdnaMessage({ return new LogdnaMessage({
line: smartlogPackageArg.message, line: smartlogPackageArg.message,
meta: smartlogPackageArg.logContext, meta: smartlogPackageArg.logContext,
@ -77,7 +77,7 @@ export class LogdnaMessage {
ip: '0.0.0.0', ip: '0.0.0.0',
mac: 'aa:aa:aa:aa:aa:aa' mac: 'aa:aa:aa:aa:aa:aa'
}); });
}; }
/** /**
* the options of this log message * the options of this log message
@ -85,5 +85,5 @@ export class LogdnaMessage {
public options: ILogdnaMessageContructorOptions; public options: ILogdnaMessageContructorOptions;
constructor(optionsArg: ILogdnaMessageContructorOptions) { constructor(optionsArg: ILogdnaMessageContructorOptions) {
this.options = optionsArg; this.options = optionsArg;
}; }
} }

View File

@ -55,7 +55,7 @@ export class LogdnaAccount {
] ]
}; };
console.log(requestBodyObject); // console.log(requestBodyObject);
// lets post the message to logdna // lets post the message to logdna
await plugins.smartrequest.postJson(requestUrlWithParams, { await plugins.smartrequest.postJson(requestUrlWithParams, {

View File

@ -2,8 +2,4 @@ import * as smartrequest from '@pushrocks/smartrequest';
import * as smartstring from '@pushrocks/smartstring'; import * as smartstring from '@pushrocks/smartstring';
import * as smartlogInterfaces from '@pushrocks/smartlog-interfaces'; import * as smartlogInterfaces from '@pushrocks/smartlog-interfaces';
export { export { smartrequest, smartstring, smartlogInterfaces };
smartrequest,
smartstring,
smartlogInterfaces
};

View File

@ -1,19 +0,0 @@
curl "https://logs.logdna.com/logs/ingest?hostname=EXAMPLE_HOST&mac=C0:FF:EE:C0:FF:EE&ip=10.0.1.101&now=$(date +%s)" \
-u INSERT_INGESTION_KEY: \
-H "Content-Type: application/json; charset=UTF-8" \
-d \
'{
"lines": [
{
"line":"This is an awesome log statement",
"app":"myapp",
"level": "INFO",
"env": "production",
"meta": {
"customfield": {
"nestedfield": "nestedvalue"
}
}
}
]
}'