当前位置:网站首页>sql日志
sql日志
2022-07-29 05:06:00 【挂在树上】
一、添加日志的jar
<!--log4f-->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
二、添加日志的文件配置–log4j.properties
log4j.rootLogger=DEBUG, Console
#Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n
log4j.logger.java.sql.ResultSet=INFO
log4j.logger.org.apache=INFO
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
详细的日志:
#将等级为DEBUG的日志信息输出到console和file这两个目的地,console和file的定义在下面的代码
log4j.rootLogger=DEBUG,console,file
#控制台输出的相关设置
log4j.appender.console = org.apache.log4j.ConsoleAppender
log4j.appender.console.Target = System.out
log4j.appender.console.Threshold=DEBUG
log4j.appender.console.layout = org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=[%c]-%m%n
#文件输出的相关设置
log4j.appender.file = org.apache.log4j.RollingFileAppender
log4j.appender.file.File=D:/qy151/log/qy151.log
log4j.appender.file.MaxFileSize=10mb
log4j.appender.file.Threshold=DEBUG
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=[%p][%d{yy-MM-dd}][%c]%m%n
#日志输出级别
log4j.logger.org.mybatis=DEBUG
log4j.logger.java.sql=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.ResultSet=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
边栏推荐
- Academic | [latex] super detailed texlive2022+tex studio download installation configuration
- Create a mindscore environment in modelars, install mindvision, and conduct in-depth learning and training (Huawei)
- How to open IE browser by running win command
- Wechat picture identification
- WPS insert hyperlink cannot be opened. What should I do if I prompt "unable to open the specified file"!
- 【微信小程序--解决display:flex最后一行对齐问题。(不连续排列会分到两边)】
- How to solve the problem of configuring the progress every time Office2010 is opened?
- How to debug UDP port
- MySQL定时调用预置函数完成数据更新
- 电脑无法打开excel表格怎么办?excel打不开的解决方法
猜你喜欢
un7.28:redis客户端常用命令。
IOS interview preparation - Online
[untitled]
Glory 2023 push, push code ambubk
On prepayment of house purchase
让你的正则表达式可读性提高一百倍
MySQL定时调用预置函数完成数据更新
How to set row height and column width in excel? The method of setting row height and column width in Excel
[wechat applet -- solve the alignment problem of the last line of display:flex. (discontinuous arrangement will be divided into two sides)]
Traffic flow prediction pit climbing record (I): traffic flow data set, original data
随机推荐
pulsar起client客户端时(client,producer,consumer)各个配置
Conv2d of torch
Activity workflow table structure learning
Introduction of JDBC preparestatement+ database connection pool
How does WPS use smart fill to quickly fill data? WPS method of quickly filling data
Excel卡住了没保存怎么办?Excel还没保存但是卡住了的解决方法
What if the computer cannot open excel? The solution of Excel not opening
五个关联分析,领略数据分析师一大重要必会处理技能
PHP determines whether the user has logged in. If logged in, the home page will be displayed. If not, enter the login page or registration page
Wechat picture identification
Go memory model for concurrency
Network Security Learning - Intranet Security 1
Deadlock to be resolved
Torch.nn.crossentropyloss() details
Google gtest事件机制
SparkSql批量插入或更新,保存数据到Mysql中
leetcode 763. Partition Labels 划分字母区间(中等)
Spark的算子操作列表
Raspberry pie 4B + Intel neural computing stick (stick2) +yolov5 feasibility study report
1 句代码,搞定 ASP.NET Core 绑定多个源到同一个类