Skip to content

Commit

Permalink
Merge pull request #20693 from Sanne/NoStatsLogged
Browse files Browse the repository at this point in the history
Hibernate ORM: do not log stats when statistics collection is enabled
  • Loading branch information
Sanne authored Oct 12, 2021
2 parents 9a572a4 + 89f79f7 commit 64ffed5
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,9 @@ private static void producePersistenceUnitDescriptorFromConfig(
if (hibernateOrmConfig.metricsEnabled
|| (hibernateOrmConfig.statistics.isPresent() && hibernateOrmConfig.statistics.get())) {
descriptor.getProperties().setProperty(AvailableSettings.GENERATE_STATISTICS, "true");
//When statistics are enabled, the default in Hibernate ORM is to also log them after each
// session; turn that off as it's very noisy:
descriptor.getProperties().setProperty(AvailableSettings.LOG_SESSION_METRICS, "false");
}

// sql-load-scripts
Expand Down

0 comments on commit 64ffed5

Please sign in to comment.