Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

日志如何开启 #48

Open
zhangzhenhuajack opened this issue Jul 8, 2022 · 2 comments
Open

日志如何开启 #48

zhangzhenhuajack opened this issue Jul 8, 2022 · 2 comments

Comments

@zhangzhenhuajack
Copy link
Owner

开启事务日志:

logging.level.org.springframework.transaction.interceptor=TRACE

输出格式如下:

2012-08-22 18:50:00,031 TRACE - Getting transaction for [com.MyClass.myMethod]

[my own log statements from method com.MyClass.myMethod]

2012-08-22 18:50:00,142 TRACE - Completing transaction for [com.MyClass.myMethod]

Session Metrics

# Generate and log statistics
spring.jpa.properties.hibernate.generate_statistics=true
logging.level.org.hibernate.stat=DEBUG
15:37:21,964 DEBUG [org.hibernate.stat.internal.StatisticsImpl] - HHH000117: HQL: SELECT a FROM Author a WHERE a.lastName = :lastName, time: 26ms, rows: 1
15:37:21,972 INFO  [org.hibernate.engine.internal.StatisticalLoggingSessionEventListener] - Session Metrics {
    51899 nanoseconds spent acquiring 1 JDBC connections;
    30200 nanoseconds spent releasing 1 JDBC connections;
    419199 nanoseconds spent preparing 6 JDBC statements;
    21482801 nanoseconds spent executing 6 JDBC statements;
    0 nanoseconds spent executing 0 JDBC batches;
    0 nanoseconds spent performing 0 L2C puts;
    0 nanoseconds spent performing 0 L2C hits;
    0 nanoseconds spent performing 0 L2C misses;
    390499 nanoseconds spent executing 1 flushes (flushing a total of 2 entities and 2 collections);
    40233400 nanoseconds spent executing 1 partial-flushes (flushing a total of 2 entities and 2 collections)
}
@zhangzhenhuajack
Copy link
Owner Author

@zhangzhenhuajack
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant