GithubHelp home page GithubHelp logo

liu876151990 / emrys.flashlog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from emrys5/emrys.flashlog

0.0 1.0 0.0 19 KB

.net 用队列超高速写日志

Home Page: http://www.cnblogs.com/emrys5/p/flashlog.html

C# 100.00%

emrys.flashlog's Introduction

Emrys.FlashLog

.net 用队列超高速写日志

Start

1、在程序开始注册FlashLog

如在MVC中,在Global中的Application_Start注册FlashLog即可。

FlashLogger.Instance().Register();

2、写日志

  FlashLogger.Debug("Debug");
  FlashLogger.Debug("Debug", new Exception("testexception"));
  FlashLogger.Info("Info");
  FlashLogger.Fatal("Fatal");
  FlashLogger.Error("Error");
  FlashLogger.Warn("Warn", new Exception("testexception"));

备注

1、基于log4net

目前写日志基于log4net,也可以扩展使用其他的组件 log4net

2、流程

由于日志的耗时全部是IO上,所以现在是把日志放到队列中,然后让一个线程从队列中获取日志。这个导致的问题就是如果程序突然断电或者程序崩溃了,那么在队列中的还没有写到磁盘上的日志将丢失。

更多详情请至 http://www.cnblogs.com/emrys5/p/flashlog.html

emrys.flashlog's People

Contributors

emrys5 avatar

Watchers

James Cloos 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.