|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
java比较简单,没有C++的烦琐,但学习时最好有C++为基础.与JSP和SQL起应用,功能强大.对照LOG4J的设置之复杂使它广泛于愈来愈多的使用中了:Log4J设置文件完成了输入到把持台、文件、回滚文件、发送日记邮件、输入到数据库日记表、自界说标签等全套功效。择其一二利用就够用了,log4j.rootLogger=DEBUG,CONSOLE,A1,imlog4j.addivity.org.apache=true#使用于把持台log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppenderlog4j.appender.Threshold=DEBUGlog4j.appender.CONSOLE.Target=System.outlog4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayoutlog4j.appender.CONSOLE.layout.ConversionPattern=[framework]%d-%c-%-4r[%t]%-5p%c%x-%m%n#log4j.appender.CONSOLE.layout.ConversionPattern=[start]%d{DATE}[DATE]%n%p[PRIORITY]%n%x[NDC]%n%t[THREAD]n%c[CATEGORY]%n%m[MESSAGE]%n%n#使用于文件log4j.appender.FILE=org.apache.log4j.FileAppenderlog4j.appender.FILE.File=file.loglog4j.appender.FILE.Append=falselog4j.appender.FILE.layout=org.apache.log4j.PatternLayoutlog4j.appender.FILE.layout.ConversionPattern=[framework]%d-%c-%-4r[%t]%-5p%c%x-%m%n#UsethislayoutforLogFactor5analysis#使用于文件回滚log4j.appender.ROLLING_FILE=org.apache.log4j.RollingFileAppenderlog4j.appender.ROLLING_FILE.Threshold=ERRORlog4j.appender.ROLLING_FILE.File=rolling.loglog4j.appender.ROLLING_FILE.Append=truelog4j.appender.ROLLING_FILE.MaxFileSize=10KBlog4j.appender.ROLLING_FILE.MaxBackupIndex=1log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayoutlog4j.appender.ROLLING_FILE.layout.ConversionPattern=[framework]%d-%c-%-4r[%t]%-5p%c%x-%m%n#使用于socketlog4j.appender.SOCKET=org.apache.log4j.RollingFileAppenderlog4j.appender.SOCKET.RemoteHost=localhostlog4j.appender.SOCKET.Port=5001log4j.appender.SOCKET.LocationInfo=true#SetupforLogFacter5log4j.appender.SOCKET.layout=org.apache.log4j.PatternLayoutlog4j.appender.SOCET.layout.ConversionPattern=[start]%d{DATE}[DATE]%n%p[PRIORITY]%n%x[NDC]%n%t[THREAD]%n%c[CATEGORY]%n%m[MESSAGE]%n%n#LogFactor5Appenderlog4j.appender.LF5_APPENDER=org.apache.log4j.lf5.LF5Appenderlog4j.appender.LF5_APPENDER.MaxNumberOfRecords=2000#发送日记给邮件log4j.appender.MAIL=org.apache.log4j.net.SMTPAppenderlog4j.appender.MAIL.Threshold=FATALlog4j.appender.MAIL.BufferSize=10log4j.appender.MAIL.From=web@www.wuset.comlog4j.appender.MAIL.SMTPHost=www.wusetu.comlog4j.appender.MAIL.Subject=Log4JMessagelog4j.appender.MAIL.To=web@www.wusetu.comlog4j.appender.MAIL.layout=org.apache.log4j.PatternLayoutlog4j.appender.MAIL.layout.ConversionPattern=[framework]%d-%c-%-4r[%t]%-5p%c%x-%m%n#用于数据库log4j.appender.DATABASE=org.apache.log4j.jdbc.JDBCAppenderlog4j.appender.DATABASE.URL=jdbc:mysql://localhost:3306/testlog4j.appender.DATABASE.driver=com.mysql.jdbc.Driverlog4j.appender.DATABASE.user=rootlog4j.appender.DATABASE.password=log4j.appender.DATABASE.sql=INSERTINTOLOG4J(Message)VALUES([framework]%d-%c-%-4r[%t]%-5p%c%x-%m%n)log4j.appender.DATABASE.layout=org.apache.log4j.PatternLayoutlog4j.appender.DATABASE.layout.ConversionPattern=[framework]%d-%c-%-4r[%t]%-5p%c%x-%m%nlog4j.appender.A1=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.A1.File=SampleMessages.log4jlog4j.appender.A1.DatePattern=yyyyMMdd-HH.log4jlog4j.appender.A1.layout=org.apache.log4j.xml.XMLLayout#自界说Appenderlog4j.appender.im=net.cybercorlin.util.logger.appender.IMAppenderlog4j.appender.im.host=mail.cybercorlin.netlog4j.appender.im.username=usernamelog4j.appender.im.password=passwordlog4j.appender.im.recipient=corlin@cybercorlin.netlog4j.appender.im.layout=org.apache.log4j.PatternLayoutlog4j.appender.im.layout.ConversionPattern=[framework]%d-%c-%-4r[%t]%-5p%c%x-%m%n
主要缺点就是:速度比较慢,没有C和C++快 |
|