Git Product home page Git Product logo

funk-js-agent's Introduction

Funk-js-agent

This is a lib to send Logmessages directly from your Javascript/Node.js Application to a Funkserver

How to use

You need a running Funkserver.

You need to know the Access-Key.

Installation

npm install funk-agent --save

Integration

Optimal you have a loging lib like winston or something else.

IMPORTANT:

set this Code by Applicationstart:

const {FunkAgent} = require('funk-agent')
const funk_con = new FunkAgent("[ServerURL]","[ACCESSKEY]")

And now you can log inside you logging event.

  funk_con.sendSugar({
    attr: {
      container: "Test", // attributesinformation to specify this application
      hostname: "spezial host", // attributesinformation to specify the server

    },
    data: [{ // A free to choose obj. use what you want. 
      message: "high obj", 
      time: new Date(Date.now()),
      request_time: 0.002,
      request_type: "ms",
    }],
    searchindex: "test-js-agent-sugar" //the elasticsearchindex where this information will be saved. 
  })

You can choose the function sendSugar and send

sendSugar is a littlebit slower but easier to use

send is faster but more complex.

Normally sendSugar will be fast enough.

Good to know

If the application lost the connection to your server. It will automatically try to reconnect. You send messages will be add to a queue and sending later. After connection is back.

Example Project

Here is a small example Projekt: funk-js-agent-example

funk-js-agent's People

Watchers

 avatar  avatar  avatar

Forkers

fossabot

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.