npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@teragrep/jsa_01

v1.0.1-rc7

Published

Javascript appender library

Downloads

7

Readme

javascript appender

Create appender for log4js-node to enable RELP usage from node.js applications.

User Story: As a developer I would like to use jsa_01 to push log messages over relp to a compatible relp-server with syslog envelope

== Specs

^^^^^ Requirements Backlog [options="header,footer"] |======================= |# |Title |User Story |Importance |Status |1 |Rebind |Rebind of the rlp_02 connection must be done after configureable amount of messages | OPTIONAL |Open |2 |Syslog |Wrap messages in syslog envelope |Must Have |WIP |3 |RELP |Use rlp_02 library |Must Have |Done |4 |Lossless|Retry indefinitely and do not lose messages |Must Have |Open |5 |Robust|Processing must not hang indefinitely due to techinical issues but rather retry new connection |Must Have |Open |6 |Source Data |Must include origin data in syslog structure-data within source-metadata | Must Have |WIP |7 |Originator |Must include hostname within new syslog structured-data (SD) so utilization systems can utilize it |Must Have |Done |8 |app-name |Syslog app-name must be configureable |Must Have |Done |9 |hostname|syslog hostname must be configureable |Must Have |Done |10 |server port|Server ports need to be configureable |Must Have |Done |11 |Server address |server address needs to be configureable | Must Have |Done |12 |Expose error SyslogMessage |Erros(expecptions) must not be hidden |Must Have |Open |13 |Extra libraries |Do not use extra libraries |Must Have |Open |14 |Variable checking|Check variables provided via configuration to be valid and raise errors if not in initilization |Must Have |Done |15 |Debug flags|Allow passing debulg flags via configuration |OPTIONAL |Open

|=======================

== High-level Architecture

image::https://github.com/teragrep/jsa_01/blob/base-feat/images/JSA_01.png[]

== Implementation

The jsAppender to push log messages over relp to a compatible relp-server with syslog envelope. For the RELP connection - rlp_02 + Generate the Syslog message - rlo_08 + RELP compatible server - Java-relp-server-demo (tested on)

  • asynchronus behaviour completely controlled by the Jasmine async works.

[source,node]

npm install

  • Module usage:
  • The appender uses the rlo_08 for handling formatting log messages and rlp_02 to send the log event message to the RELP Server. [source,javascript]

const { SyslogMessage, Facility, SDElement, SDParam, Severity } = require('@teragrep/rlo_08') const { RelpConnection, RelpBatch } = require('@teragrep/rlp_02')

  • Build

[source,java]

mvn clean package

  • OPTIONAL TIPS

async waterfall method also possible for run in the node engine (need to adjust the code).

== Configuration

  • *_type_* - *_jsAppender_*
  • *_hostname_* - *_string_* (defaults to os.hostname()) - origin of the log messages
  • *_appname_* - *_string_*
  • *_serverAddress_* - *_string_*
  • *_serverPort_* - *_integer_* (defaults to 1601) - Port of the relp server is listening in

== Example (default config) [source,javascript]

log4js.configure( { appenders: {jsa: { type: jsAppender, appName: 'teragrep' }, console: { type: 'console' }, }, categories: { jsa: { appenders: ['jsa'], level: 'error' }, default: { appenders: ['jsa'], level: 'trace' }, }, })

This configuration will send the log event messages to the RELP Server.