Comments (2)
Asynclog
-
Asynclog是基于linux系统服务rsyslog.d和vsyslog实现的异步日志工具。模块引用了phxrpc框架异步日志工具,并进行了二次封装。
-
vsyslog 只进行了日志生产工作,通过domain socket发送给rsyslog.d服务,并由rsyslog.d服务进行分发落地,日志路径限于/var/log。
-
结构图: [ vsyslog <------> rsyslog.d <------> 日志]
使用说明
- 引用头文件nc_log.h
- 配置rsyslog.d/$serverName.conf
- 重启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.
Merged #2. Feature is integrated.
from ncserver.
Related Issues (10)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ncserver.