日志系统

2017/02/12 iteye

异步log to file 1. 启动一个多线程,维护一个List列表。List中存放的是需要log的字符串。早期用Vector来考虑同步的问题,甚至可以包装Vector。加入wait/notify机制。 2. 主程序启动时打开文件,主程序结束时关闭文件。其他还有异常,rotate file时也需要关闭文件。   // Open the file output stream             logOutputStream = new FileOutputStream(this.fileName);          &nbs

Search

    Table of Contents