Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the categories of Hibernate logs

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the categories of Hibernate logs". Interested friends may wish to have a look at them. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the categories of Hibernate logs.

In Hibernate, Hibernate logs use Apache commons-logging to log various events.

Commons-logging will be output directly to Apache Log4j (if log4j.jar is included in the classpath) or JDK1.4 logging (if running in JDK1.4 or above).

We strongly recommend that you familiarize yourself with Hibernate's log messages. Without losing readability, we have done a lot of work to make Hibernate logs as detailed as possible. This is a necessary tool for error checking. The most interesting log categories are as follows:

Table Hibernate log categories

Category

Function

Org.hibernate.SQL

Log all SQL DML statements when they are executed

Org.hibernate.type

Log all JDBC parameters

Org.hibernate.tool.hbm2ddl

Log all SQL DDL statements as they are executed

Org.hibernate.pretty

During session cleaning (flush), log the status of all entities associated with it (up to 20)

Org.hibernate.cache

Log all second-tier cache activity

Org.hibernate.transaction

Log transaction-related activities

Org.hibernate.jdbc

Log the acquisition of all JDBC resources

Org.hibernate.hql.AST

When parsing the query, record the AST analysis logs for HQL and SQL

Org.hibernate.secure

Log JAAS authentication requests

Org.hibernate

Log any Hibernate-related information (large amount of information, but very helpful for error checking)

When developing applications using Hibernate, you should always turn on debug-level logging for org.hibernate.SQL, or turn on the hibernate.show_sql property.

At this point, I believe you have a deeper understanding of "what are the categories of Hibernate logs?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report