Giter Site home page Giter Site logo

Comments (2)

PowerfulWolf avatar PowerfulWolf commented on September 6, 2024

Asynclog

  • Asynclog是基于linux系统服务rsyslog.d和vsyslog实现的异步日志工具。模块引用了phxrpc框架异步日志工具,并进行了二次封装。

  • vsyslog 只进行了日志生产工作,通过domain socket发送给rsyslog.d服务,并由rsyslog.d服务进行分发落地,日志路径限于/var/log。

  • 结构图: [ vsyslog <------> rsyslog.d <------> 日志]

使用说明

  1. 引用头文件nc_log.h
  2. 配置rsyslog.d/$serverName.conf
  3. 重启rsyslog.d服务
  • 备注

  • 我们提供了服务配置文件生成脚本(~/config/generate_config.py),可用于参考。

example

#include "nc_log.h"
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include <stdio>
int main()
{
   _registerUpdateLogLevelSignal();
   Logger::instance().init("example", LOG_ERR);
   struct timeval tvStart, tvEnd;
   struct timezone tzStart, tzEnd;
   gettimeofday(&tvStart, &tzStart);
   while(i<10000)
   {
      ASYNC_LOG_INFO("TEST LOG %d", LOG_INFO);
      i++;
   }
   gettimeofday(&tvEnd, &tzEnd);
   prinf("consume time is: %d ms", (tvEnd.tv_sec - tvStart.tv_sec)*1000 + (tvEnd.tv_usec - tvStart.tv_usec)/1000);
}

from ncserver.

kingsimba avatar kingsimba commented on September 6, 2024

Merged #2. Feature is integrated.

from ncserver.

Related Issues (10)

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.