New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@tuia/koa-log

Package Overview
Dependencies
Maintainers
8
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tuia/koa-log

支持错误日志和大数据日志

latest
npmnpm
Version
3.2.0
Version published
Maintainers
8
Created
Source

@tuia/koa-log

TuiaLogger: 系统日志 - 系统报错等

InnerLogger: 数仓日志 - 接入大数据

How to use

yarn add @tuia/koa-log
const KoaLog = require('@tuia/koa-log');
app.use(KoaLog);

/** 全局使用 **/
// debug, info, warn, error
global.TuiaLogger.info('system', 'haha');

// 只能用info
global.InnerLogger.info({
  group: 1,
  type: 2,
  json: {
    pageId: 1
  }
});

/** 中间件使用 **/
async(ctx, next) => {
  // debug, info, warn, error
  ctx.TuiaLogger.info('system', 'haha');

  // 只能用info
  ctx.InnerLogger.info({  // 只能用info
    group: 1,
    type: 2,
    json: {
      pageId: 1
    }
  });
}

注意

项目中的 Dockfile 需要修改 workspace(方便日志包获取应用名)

RUN mkdir /root/duiba-deploy/
ADD ./duiba-deploy /root/duiba-deploy/
WORKDIR /root/duiba-deploy/
#define entry point which will be run first when the container starts up
ENTRYPOINT node server

CHANGELOG

3.0.0 (2020-09-17) - 升级 log4js 包到 6.x 版本 3.2.0 (2020-09-23) - 去掉日志切割时 compress 压缩配置项

FAQs

Package last updated on 23 Sep 2020

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