log4j日志如何存入数据库
来源:互联网 发布:十三张源码 编辑:程序博客网 时间:2024/06/05 05:34
# This defines the logging level for the rootLogger. It is not required
# if you are going to keep the level at debug as the rootLogger by default
# is at the debug level. The value after the comma is the appender for the
# root and we have given it the name R
#
log4j.rootLogger=debug, R
#
# Since we plan to log to a database, we tell log4j that we will use the
# JDBCAppender. To complete the configuration for this, we need to tell
# some basic things to this appender. Database, Username, password and the
# actual values to log. %m represents the message that will be generated by
# our log statements.
#
log4j.appender.R=org.apache.log4j.jdbc.JDBCAppender
#数据库连接串
log4j.appender.R.URL=jdbc:mysql://localhost/test
log4j.appender.R.user=root
log4j.appender.R.password=
log4j.appender.R.sql=INSERT INTO messages (message) VALUES ('%d - %c - %p - %m')#
# These definea the layout to be used.
#
log4j.appender.R.layout=org.apache.log4j.PatternLayout
上面是log4j的配置文件的内容。
在数据库中建立一个messages表,表中有message字段。
- log4j日志如何存入数据库
- Log4J使用实例---日志进行邮件发送或是存入数据库
- log4j日志写入数据库
- log4j日志写入数据库
- log4j java版如何将日志写入数据库
- 如何借助log4j把日志写入数据库中
- 如何把Session存入数据库
- 如何把session存入数据库
- python 将增量文件日志存入数据库
- Win2003计数器日志自动存入SQL数据库
- 如何把数组做为一个字段存入存入数据库
- 如何把数组做为一个字段存入存入数据库
- aop log4j mdc实现自定义字段存入数据库
- log4j 日志保存到数据库
- log4j日志存储到数据库
- log4j日志存储到数据库
- 将Log4j日志写入数据库
- log4j日志存储到数据库
- wxWidgets/wxPython的开源界面设计器wxGlade-0.4.1的预览问题
- VB编程的一些小技巧 - 关于vb字符串操作的优化
- 表中的行变为列显示汇总(行列转换显示)的例子
- 让表格的列自适应内容(列内容不换行)
- 网上开店,真的需要缴税
- log4j日志如何存入数据库
- ASP.NET HTTP模块和处理程序(3)
- 实用SQL语句
- Win9X系统中如何锁定光驱
- 理财知识
- Flash生成唯一的标识的类AloneFlag.as
- 利用Bochs调试linux的启动过程
- Gartner:电子垃圾泛滥,业界需要绿色科技
- Google推新版桌面搜索工具 安全性能增强