Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the categories of Hibernate logs

Shulou Source: shulou.com Published: 2022-06-02 08:03:16 10月01日 Update

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!

Tags: Logs categories information interests content statements learning queries activities practical deeper larger necessary events transactions amount of information sharp tools premises functions parameters Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MySQL Apple Docker Linux