Skip to content

HHH-19611 demote many DEBUG-level log messages to TRACE #10525

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

Merged
merged 32 commits into from
Jul 14, 2025

Conversation

gavinking
Copy link
Member

Redo of #10520.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


gavinking added 23 commits July 13, 2025 23:58
since Quarkus insists on doing something completely crazy with our INFO level
put them all in a single log message
because it results in logging telling us not to do it
and clean up some Logger descriptions
…to JdbcLogging

and include SF uuid in log messages
at least for now - it was just too verbose
at least for now - it was just too ugly and verbose
motivated by work on logging cleanup
@gavinking gavinking marked this pull request as ready for review July 13, 2025 22:00
@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Jul 13, 2025

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [74f8976, 055b4fe, 8ba81d4, a311903, 7495085, d5ec2f6, 6b9a6d3, 0e14088, e3a06c6, 5113f19, 7d2fc89, e3d89dd, 60a413c, 142b9c6, 13215a5, 6c7d383, 639a7b9, 4133366, a70ea5e, f3baef5, a9f8e4b, b78d8ef, 4e9d3a8, af4342b, 363308a, 41fcfa0, c041ec4, 4404d9c, 1c8dcc2]

› This message was automatically generated.

if ( log.isDebugEnabled() ) {
log.debugf( "Performing JAXB binding of hbm.xml document : %s", origin.toString() );
if ( log.isTraceEnabled() ) {
log.tracef( "Performing JAXB binding of hbm.xml document: %s", origin.toString() );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
@@ -181,7 +181,7 @@
else {
assert "entity-mappings".equals( rootElementLocalName );
try {
log.debugf( "Performing JAXB binding of orm.xml document : %s", origin.toString() );
log.tracef( "Performing JAXB binding of orm.xml document: %s", origin.toString() );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
@@ -1015,7 +1015,7 @@
public Object immediateLoad(String entityName, Object id) {
if ( log.isDebugEnabled() ) {
final EntityPersister persister = requireEntityPersister( entityName );
log.debugf( "Initializing proxy: %s", infoString( persister, id, getFactory() ) );
log.tracef( "Initializing proxy: %s", infoString( persister, id, getFactory() ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +144 to +145
LOG.trace( "Caching collection: "
+ collectionInfoString( collectionDescriptor, collectionInstance, key, session ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
// Incredibly verbose logging disabled
// LOG.tracef( "Adding type registration %s -> %s", key, type );

final Type old = typesByName.put( key, type );

Check notice

Code scanning / CodeQL

Unread local variable Note

Variable 'Type old' is never read.
// Incredibly verbose logging disabled
// LOG.tracef( "Adding type registration %s -> %s", key, type );

final BasicTypeReference<?> old = typeReferencesByName.put( key, type );

Check notice

Code scanning / CodeQL

Unread local variable Note

Variable 'BasicTypeReference<?> old' is never read.
@@ -38,7 +39,7 @@
* Create an {@link XmlSource} from a named resource
*/
public static XmlSource fromResource(String resourceName, ClassLoaderService classLoaderService) {
JaxbLogger.JAXB_LOGGER.tracef( "reading mappings from resource : %s", resourceName );
JAXB_LOGGER.tracef( "Reading mappings from resource: %s", resourceName );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +84 to +85
MULTI_KEY_LOAD_LOGGER.trace( "Batch fetching collection: "
+ collectionInfoString( getLoadable(), key ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +110 to +111
MULTI_KEY_LOAD_LOGGER.trace( "Finishing initializing batch-fetched collection: "
+ collectionInfoString( attributeMapping, key ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +49 to +50
MULTI_KEY_LOAD_LOGGER.trace( "Batch fetching entity: "
+ infoString( getLoadable(), id ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +64 to +65
MULTI_KEY_LOAD_LOGGER.trace( "Batch fetching entity: "
+ infoString( getLoadable(), id ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +120 to +121
MULTI_KEY_LOAD_LOGGER.trace( "Batch fetching collection: "
+ collectionInfoString( getLoadable(), keyBeingLoaded ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
key,
MULTI_KEY_LOAD_LOGGER.tracef(
"Processing collection batch-fetch chunk (%s) %s - %s",
collectionInfoString( getLoadable(), key ),

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +158 to +159
LOADER_LOGGER.trace( "Retrieving snapshot of current persistent state for "
+ infoString( entityDescriptor, id ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
getLoadable().getEntityName(), id, Arrays.toString(idsToInitialize) );
if ( MULTI_KEY_LOAD_LOGGER.isTraceEnabled() ) {
MULTI_KEY_LOAD_LOGGER.tracef( "Entity ids to initialize via batch fetching (%s) %s",
infoString( getLoadable(), id),

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
getLoadable().getEntityName(), pkValue, Arrays.toString(idsToInitialize) );
if ( MULTI_KEY_LOAD_LOGGER.isTraceEnabled() ) {
MULTI_KEY_LOAD_LOGGER.tracef( "Entity ids to initialize via batch fetching (%s) %s",
infoString( getLoadable(), pkValue ),

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
if ( MULTI_KEY_LOAD_LOGGER.isTraceEnabled() ) {
MULTI_KEY_LOAD_LOGGER.tracef(
"Processing entity batch-fetch chunk (%s) %s - %s",
infoString( getLoadable(), pkValue ),

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
final boolean traceEnabled = L2CACHE_LOGGER.isTraceEnabled();
if ( traceEnabled ) {
L2CACHE_LOGGER.tracef( "Getting cached data from region ['%s' (%s)] by key [%s]",
getRegion().getName(), getAccessType(), key );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
log.debugf( "Cache miss : region = `%s`, key = `%s`", getRegion().getName(), key );
if ( traceEnabled ) {
L2CACHE_LOGGER.tracef( "Cache miss: region = '%s', key = '%s'",
getRegion().getName(), key );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
log.debugf( "Cache hit : region = `%s`, key = `%s`", getRegion().getName(), key );
if ( traceEnabled ) {
L2CACHE_LOGGER.tracef( "Cache hit: region = '%s', key = '%s'",
getRegion().getName(), key );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
log.debugf( "Cache hit, but item is unreadable/invalid : region = `%s`, key = `%s`", getRegion().getName(), key );
if ( traceEnabled ) {
L2CACHE_LOGGER.tracef( "Cache hit, but item is unreadable/invalid: region = '%s', key = '%s'",
getRegion().getName(), key );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +111 to +112
L2CACHE_LOGGER.tracef( "Caching data from load [region='%s' (%s)] : key[%s] -> value[%s]",
getRegion().getName(), getAccessType(), key, value );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +163 to +164
L2CACHE_LOGGER.tracef( "Locking cache item [region='%s' (%s)] : '%s' (timeout=%s, version=%s)",
getRegion().getName(), getAccessType(), key, timeout, version );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
);
if ( L2CACHE_LOGGER.isTraceEnabled() ) {
L2CACHE_LOGGER.tracef( "Unlocking cache item [region='%s' (%s)] : %s",
getRegion().getName(), getAccessType(), key );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
@@ -205,7 +205,7 @@

protected void handleLockExpiry(SharedSessionContractImplementor session, Object key, Lockable lock) {
L2CACHE_LOGGER.softLockedCacheExpired( getRegion().getName(), key );
log.debugf( "Cached entry expired : %s", key );
L2CACHE_LOGGER.tracef( "Cached entry expired: %s", key );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
@@ -219,7 +219,9 @@
@Override
public void remove(SharedSessionContractImplementor session, Object key) {
if ( getStorageAccess().getFromCache( key, session ) instanceof SoftLock ) {
log.debugf( "Skipping #remove call in read-write access to maintain SoftLock : %s", key );
if ( L2CACHE_LOGGER.isDebugEnabled() ) {
L2CACHE_LOGGER.debugf( "Skipping remove call in read-write access to maintain SoftLock: ", key );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
@gavinking
Copy link
Member Author

This is massive now, so I'm going to just merge it.

@gavinking gavinking merged commit 05684de into hibernate:main Jul 14, 2025
22 of 23 checks passed
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

Successfully merging this pull request may close these issues.

1 participant