🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

light-api-log4j

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

light-api-log4j

the plugin of the light-api server for log service

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

light-api-log4j

2018-03-13 发布0.0.1版本

//使用

  • 引入框架
 
 let logconf = require(`./${env}/log.json`);
 ... ...
  "plugins":{
                "light-api-log4j":logconf    
            }

  • 配置 /log.json
{
  "appenders": {
    "sysMsg": { "type": "stdout" },
    "app": { "type": "file", "filename": "data.log" }
  },
  "categories": {
    "default": { "appenders": [ "sysMsg", "app" ], "level": "debug" }
  }

3.使用


handler: function (request, reply) {
   let logger = this.getLogger(__filename,category);

    logger.trace('LIGHT trace ...');
    logger.debug('LIGHT debug ...');
    logger.info('LIGHT info ...');
    logger.warn('LIGHT warn ...');
    logger.error('LIGHT error ...');
    logger.fatal('LIGHT fatal ...');

    ... ...
}

FAQs

Package last updated on 13 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts