如何在Spring Boot / JPA / Hibernate Show_sql中关闭日志记录到文件是真的

时间:2018-01-19 01:05:23

标签: spring hibernate jpa spring-boot spring-data-jpa

我的属性中show_sql为true,因为我希望它在IntelliJ中运行Spring Boot服务器应用程序时将查询记录到我的控制台中。我们没有任何配置将它们写入文件,但由于某种原因它正在尝试写入文件。这是我们在线程转储中看到的内容

"http-nio-8080-exec-2" #28 daemon prio=5 os_prio=31 tid=0x00007fa208deb000 nid=0x9403 runnable [0x000070000bef8000]
java.lang.Thread.State: RUNNABLE
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:326)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
- locked <0x00000006c00430b8> (a java.io.BufferedOutputStream)
at java.io.PrintStream.write(PrintStream.java:480)
- locked <0x00000006c0043098> (a java.io.PrintStream)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:104)
- locked <0x00000006c00431d8> (a java.io.OutputStreamWriter)
at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:185)
at java.io.PrintStream.write(PrintStream.java:527)
- locked <0x00000006c0043098> (a java.io.PrintStream)
at java.io.PrintStream.print(PrintStream.java:669)
at java.io.PrintStream.println(PrintStream.java:806)
- locked <0x00000006c0043098> (a java.io.PrintStream)
at org.hibernate.engine.jdbc.spi.SqlStatementLogger.logStatement(SqlStatementLogger.java:111)

SQL的所有其他日志记录都将进入控制台。

"http-nio-8080-exec-1" #29 daemon prio=5 os_prio=31 tid=0x00007fa200fef000 nid=0x110b waiting for monitor entry [0x0000700009b8c000]
java.lang.Thread.State: BLOCKED (on object monitor)
at java.io.PrintStream.println(PrintStream.java:805)
- waiting to lock <0x00000006c0043098> (a java.io.PrintStream)
at org.hibernate.engine.jdbc.spi.SqlStatementLogger.logStatement(SqlStatementLogger.java:111)
at org.hibernate.engine.jdbc.spi.SqlStatementLogger.logStatement(SqlStatementLogger.java:94)

我已经在我们的代码库中到处搜索,试图找到任何可能使它想要记录到文件的内容,即使在IntelliJ的运行配置中,但我没有运气。

我希望它停止记录到文件,因为它最终会挂起我的IDE。

0 个答案:

没有答案