提供现成的java日志类,100分。。。。。。。。。。。。。

joachern 2004-06-07 03:23:23
提供现成的java日志类,100分。。。。。。。。。。。。。
...全文
147 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
cxj_2000 2004-06-07
  • 打赏
  • 举报
回复
详细请看tomcat 4.1.30代码看:

org.apache.catalina.logger 包里面吧,告诉你怎么写日志。
北极猩猩 2004-06-07
  • 打赏
  • 举报
回复
log4j
commons-logging
多的是啊
fangrong 2004-06-07
  • 打赏
  • 举报
回复
www.apache.org
bengan 2004-06-07
  • 打赏
  • 举报
回复
在哪里可以下载log4j!??
pleonheart 2004-06-07
  • 打赏
  • 举报
回复
用log4j
chensky 2004-06-07
  • 打赏
  • 举报
回复
package common;

import java.io.*;
import java.sql.*;

public class Log {

public Log(){
}

private static String filePath = "c:"+System.getProperty("file.separator")+"log.txt";

public void setFilePath( String str ){
filePath = str;
}

public static void write( String str ){
File fl = new File( filePath );
FileOutputStream fo = null;
try{

if( !fl.exists() ) fl.createNewFile();

if( str == null ) str = "";

fo = new FileOutputStream( filePath, true );
fo.write( Util.getNow(3).getBytes() );
fo.write( 32 );
fo.write( 32 );
fo.write( str.getBytes() );
fo.write( 13 );
fo.write( 10 );

}catch( Exception e ){
e.printStackTrace();
}finally{
if( fo != null )
try {
fo.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}

Arias 2004-06-07
  • 打赏
  • 举报
回复
什么要求呀!
log4j包是实现日至的,你可以看看!
Philzzf 2004-06-07
  • 打赏
  • 举报
回复
log4j啊

62,615

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧