GithubHelp home page GithubHelp logo

hbei / flogger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cyfonly/flogger

0.0 2.0 0.0 66 KB

基于双缓冲队列、多刷盘机制的超轻量级 java 日志

Home Page: http://www.cnblogs.com/cyfonly/p/6139049.html

License: Other

Java 100.00%

flogger's Introduction

design
License
基于双缓冲队列、多刷盘机制的超轻量级 java 日志

Features

  1. 双缓冲队列
  2. 多种刷盘机制,支持时间触发、缓存大小触发、服务关闭强制触发等刷盘方式
  3. 多种RollingFile机制,支持文件大小触发、按天触发等Rolling方式
  4. 多日志级别,支持debug、info、warn、error和fatal等日志级别
  5. 热加载,由日志事件触发热加载
  6. 超轻量,不依赖任何第三方库
  7. 性能保证,成功用于日交易额百亿级交易系统  

Usage  

add flogger.jar to your project

//获取单例
FLogger logger = FLogger.getInstance();
//简便api,只需指定内容
logger.info("Here is your message...");
//指定日志级别和内容,文件名自动映射
logger.writeLog(Constant.INFO, "Here is your customized level message...");
//指定日志输出文件名、日志级别和内容
logger.writeLog("error", Constant.ERROR, "Here is your customized log file and level message...");

Output

info.log

[INFO] 2016-12-06 21:07:32:840 [main] Here is your message...

warn.log

[WARN] 2016-12-06 21:07:32:842 [main] Here is your customized level message...

error.log

[ERROR] 2016-12-06 21:07:32:842 [main] Here is your customized log file and level message...

Config  

log.properties(项目根路径下)

########## 公共环境配置 ##########
# 字符集
CHARSET_NAME = UTF-8
########## 日志信息配置 ##########
# 日志级别   0:调试信息  1:普通信息   2:警告信息  3:错误信息  4:严重错误信息 
LOG_LEVEL = 0,1,2,3,4
# 日志文件存放路径
LOG_PATH =./log
# 日志写入文件的间隔时间(默认为1000毫秒)
WRITE_LOG_INV_TIME = 1000
# 单个日志文件的大小(默认为10M)
SINGLE_LOG_FILE_SIZE = 10485760
# 单个日志文件缓存的大小(默认为10KB)
SINGLE_LOG_CACHE_SIZE = 10240

License

MIT

flogger's People

Contributors

cyfonly avatar

Watchers

James Cloos avatar  avatar

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.