Giter Club home page Giter Club logo

mailog's Introduction

Mailog

Mailog is useful Logging module.

This module lets you log events simply and can get logs by E-Mail and Website. By using Mailog into your project, You won't be worry about event log of your services.

Install

$ npm install mailog

Usage

Initalize Module

You need to initalize module before logging. Init Function requires log and web Objects. First, You should write information related to your mail account in the log section. Second, You should write authenication data into the web section.

Your input will be encrypted via bcrypt and base64.

Example:

const mailog = require('mailog');
// import * as mailog from 'mailog';
mailog.init({ // Log Part
    host: "smtp.hanmail.net",
    port: 465,
    svcName: "Your Service Name",
    useSecureConnection: true,
    auth: {
        id: "your id",
        pass: "your password"
    },
    sender: "your email",
    receiver: "your email",
    timeZone: "Asia/Seoul"
}, { // Web Part
    use: true, // or false
    port: 5002, // if you want to use web part, set use to true and set port
    auth: {
        id: 'admin',
        pass: 'admin'
    }
})

Log Event

Use mailog.info to log information level. Mailog have 4 Log Level, info, warn, error, debug.

Example:

const mailog = require('mailog');
// import * as mailog from 'mailog';

mailog.info("Hello World!", false); //false means don't mail this log.
mailog.warn("Watch Out!", true);
mailog.error("There is an error...", false);
mailog.debug("Bezzzz. I'm bug!", true);

Check Logs on Web

Log web's default port is 5001. you can acccess web logs at http://your.domain:5001

Examples

If you need example file, you can get examples here.

Credits

License

GNU GPL 3.0 License

mailog's People

Contributors

ninejuan avatar

Stargazers

PreviousW avatar  avatar Asta(아스타) avatar

Watchers

 avatar

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.