我正在尝试在 springboot 和 springdata 应用程序中设置 SQL 语句的休眠日志记录。
我在 application.properties 文件中设置以下属性:
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type=TRACE
Run Code Online (Sandbox Code Playgroud)
但不知何故,它们没有被拾取,也没有 sql 日志出现。也尝试过设置 spring.jpa.show-sql 属性,但似乎不起作用。
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>in.abcd</groupId>
<artifactId>spring-boot-commons</artifactId>
<version>1.0.10</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</exclusion>
<exclusion>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-52</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<version>2.1.6.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion> …Run Code Online (Sandbox Code Playgroud) int dp[2009][2009]
static int dp[2009][2009];
Run Code Online (Sandbox Code Playgroud)
我制作了一个c ++程序,其中我声明了一个arry作为
int dp [2000] [2000]该程序由于非常大的内存分配而停止工作.当我宣布它为静态
int dp [2009] [2009]时,该程序运行良好.什么原因?