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

node-imx-logger

v1.3.2

Published

Imaxeam logger for node

Downloads

57

Readme

IMX LOGGER FOR NODE JS

Installation

Step1

yarn add node-imx-logger

or

npm i node-imx-logger

Usage

To establish a connection with the imxLogger server, utilize the following method, ensuring the inclusion of specific options and parameters:

  • The code above establishes a connection to the IMX Logger using the LOGGER.createConnectionToRabbitMQ() function.

    • The options object contains the RabbitMQ server connection details.
    • The extraOptions object is optional and can contain properties to enable/disable logging features and specify reconnect behavior.
    • The connectToImxLogger() function attempts to create a connection to the RabbitMQ server using the provided options and extra options. If an error occurs during the connection process, the error will be logged to the console.

    Please ensure to replace the placeholder values (localhost, 5672, user_name, password, queueName) with your actual server details.

    Additional Functions

    The LOGGER module provides several functions for logging and managing logging settings:

    Logging Functions:

    • LOGGER.error(payload: messagePayloadASArg): void: Log an error message.
    • LOGGER.debug(payload: messagePayloadASArg): void: Log a debug message.

    Logging Configuration Functions:

    • LOGGER.enableErrorLogging(): void: Enable error logging.
    • LOGGER.disableErrorLogging(): void: Disable error logging.
    • LOGGER.enableDebugLogging(): void: Enable debug logging.
    • LOGGER.disableDebugLogging(): void: Disable debug logging.
    • LOGGER.checkLoggingStatus(): { errorLoggingStatus: boolean; debugLoggingStatus: boolean; }: Check the current logging status.
    • LOGGER.checkErrorLoggingStatus(): boolean: Check if error logging is enabled.
    • LOGGER.checkDebugLoggingStatus(): boolean: Check if debug logging is enabled.
    • LOGGER.setAppName(appName: string): void: Set the application name used in log messages.
    • LOGGER.enableDisableAllLogging(): void: Disable all logging.
    • LOGGER.disableDisableAllLogging(): void: Enable all logging.
    • LOGGER.checkDisableAllLoggingStatus(): boolean: Check if all logging is disabled.
    • LOGGER.enableLogOnly(): void: Enable log-only mode (logs to console, not to the queue).
    • LOGGER.disableLogOnly(): void: Disable log-only mode.
    • LOGGER.checkLogOnlyStatus(): boolean: Check if log-only mode is enabled.

    Other Functions:

    • LOGGER.getConnectionObject(): rabbitMqConnectionType: Get the current RabbitMQ connection object.
    • LOGGER.getAllExtraOptions(): ExtraOptions: Get all extra logging options.=
    • LOGGER.disconnectFromLogger(): void: Disconnect from the IMX Logger.

    Message payload

    The messagePayloadASArg type represents the payload when logging error and debug messages. It includes the following properties:

    • message (required): A string representing the main message content of the log.
    • context (required): A string specifying the context or category of the log, providing additional information about where the log is originating from.
    • user (optional): An optional string representing the user associated with the log. This property can be omitted if the log is not specific to a user.
    • extra (optional): An optional property that allows additional data or context to be included in the log. This can be of any type (any), accommodating various custom data structures or objects.

    Please note that the rabbitMqConnectionType can be null if the connection to the RabbitMQ server was unsuccessful.