GithubHelp home page GithubHelp logo

graylog-ts's People

Contributors

buehler avatar dwirz avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

graylog-ts's Issues

Ionic 2 (Angular 2) usage

Hi guys, I'm new to TypeScript and trying to use graylog-ts in a ng2 service (Ionic 2 project). I'm wondering if you could help me out? It might just be a configuration issue.

Here is my service:

import { Graylog } from 'graylog-ts';
import { Injectable } from '@angular/core';

@Injectable()
export class GraylogService {

	constructor() {
		console.log('Hello GraylogService Provider');
		console.log(Graylog);
	}

}

But once I plug it into my app providers:

import {
	IonicApp,
	IonicModule,
	// ...
} from 'ionic-angular';

import {
	NgModule,
	// ...
} from '@angular/core';

import { GraylogService } from '../providers/graylog-service';
import { MyApp } from './app.component';

@NgModule({
	bootstrap: [IonicApp],
	declarations: [
		// ...
	],
	entryComponents: [
		// ...
	],
	imports: [
		IonicModule.forRoot(MyApp),
	],
	providers: [
		GraylogService,
		// ...
	],
})
export class AppModule {}

I get this weird error:

Uncaught TypeError: Object prototype may only be an Object or null: undefined
    at create (<anonymous>)
    at Function.Object.create (polyfills.js:2)
    at inherits (inherits_browser.js:5)
    at Object.<anonymous> (index.js:5)
    at Object.<anonymous> (index.js:90)
    at __webpack_require__ (bootstrap 56af062…:19)
    at Object.<anonymous> (browser.js:7)
    at Object.<anonymous> (browser.js:52)
    at __webpack_require__ (bootstrap 56af062…:19)
    at Object.<anonymous> (index.js:4)
Object.create @ polyfills.js:2
inherits @ inherits_browser.js:5
(anonymous) @ index.js:5
(anonymous) @ index.js:90
__webpack_require__ @ bootstrap 56af062…:19
(anonymous) @ browser.js:7
(anonymous) @ browser.js:52
__webpack_require__ @ bootstrap 56af062…:19
(anonymous) @ index.js:4
__webpack_require__ @ bootstrap 56af062…:19
(anonymous) @ graylog.js:2
(anonymous) @ graylog.js:305
__webpack_require__ @ bootstrap 56af062…:19
(anonymous) @ Graylog.js:3
__webpack_require__ @ bootstrap 56af062…:19
(anonymous) @ index.js:5
__webpack_require__ @ bootstrap 56af062…:19
(anonymous) @ messages.js:13
__webpack_require__ @ bootstrap 56af062…:19
(anonymous) @ main.js:104103
__webpack_require__ @ bootstrap 56af062…:19
(anonymous) @ main.js:165011
__webpack_require__ @ bootstrap 56af062…:19
(anonymous) @ bootstrap 56af062…:65
(anonymous) @ bootstrap 56af062…:65

I've seen errors like this on platforms where core nodejs modules aren't supported and need to be shimmed with browser counterparts. Could this be the case?

I see that node-graylog2 is using a few core node modules: https://github.com/Wizcorp/node-graylog2/blob/master/graylog.js#L1-L6.

Uncaught Error: Cannot find module "dgram"

Hi,

I try to use this to log in my server Graylog from an Ionic2/Agnular2 app on Android.
But i have this error on load
Uncaught Error: Cannot find module "dgram"

providers/graylog-service.js

import { Graylog, GraylogConfig  } from 'graylog-ts';
import { Injectable } from '@angular/core';

@Injectable()
export class GraylogService {
    private graylog: Graylog;

	constructor() {
            let servers: any = [{ host: "graylog.example.com", port: 9022 }];
            this.graylog = new Graylog({ servers: servers, hostname: "graylog.example.com" });
	}
}

I have do this
npm install dgram --save
but the problem persist

An idea ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.