Abstract:
The log generation system in this paper overcomes the traditional log generation system which cannot modify the generation of modules and levels log, the configuration file can be modified and the dynamic command can be used to get selective generation of different modules and levels log in this design. This design uses the scanning of configuration file, according to the identification of different modules and levels in configuration file to update the list of log generation, the dynamic command inputs with the Inter-process Communication(IPC) in process to update the list of log generation, then uses the API interface to generate the log according to the demand.
Key words:
log generation system,
configuration file,
dynamic command,
Linux kernel,
system call,
API-interface,
Inter-process Communication(IPC)
摘要: 提出一种日志生成系统,克服传统系统不能在进程中随意更改日志生成的模块与级别。通过修改配置文件和用动态命令2种方式,进行不同模块、不同级别的日志选择性生成。该设计可以用扫描配置文件的方式,根据配置文件中不同模块与级别的标识更新日志生成列表,也可以在进程运行当中,以人机交互的命令通过进程间通信的方法更新日志生成列表,再调用API接口实现按需生成日志。测试结果表明,该设计可以实现按需求输出日志的功能。
关键词:
日志生成系统,
配置文件,
动态命令,
Linux内核,
系统调用,
API接口,
进程间通信
CLC Number:
LIU Hong-Wu, LIANG Liang, YANG Guo-Wei, SONG Gao-Dun. Intelligent Log Generation System Based on Linux Kernel[J]. Computer Engineering, 2012, 38(18): 255-257.
刘洪武, 梁亮, 杨国为, 宋高俊. 基于Linux内核的智能日志生成系统[J]. 计算机工程, 2012, 38(18): 255-257.