Class BigQueryJdbcResultSetLogger (1.10.0)

public final class BigQueryJdbcResultSetLogger

High-performance logging facade for ResultSet and its related classes.

This is deliberately not a java.util.logging.Logger. Every Logger instance registers itself as a child of its parent under a JVM-wide lock and that registration is never released, so a logger-per-ResultSet leaks. Instead, one real BigQueryJdbcCustomLogger is created per class and shared; this facade holds a reference to it plus the connection ID of the ResultSet it serves.

Hot-path methods (finestTrace etc.) set the source class and method explicitly, so no stack-trace walking (caller inference) happens for them. The connection ID is stamped into LogRecord.getParameters()[0] on every record so PerConnectionFileHandler can route the record even when the thread-local MDC (mapped diagnostic context — the per-thread connection ID set by the JDBC proxy) is empty, which is the normal case for un-proxied ResultSet calls.

Inheritance

java.lang.Object > BigQueryJdbcResultSetLogger

Static Methods

getLogger(Class<?> clazz)

public static BigQueryJdbcResultSetLogger getLogger(Class<?> clazz)
Parameter
Name Description
clazz Class<?>
Returns
Type Description
BigQueryJdbcResultSetLogger

getLogger(Class<?> clazz, String connectionId)

public static BigQueryJdbcResultSetLogger getLogger(Class<?> clazz, String connectionId)
Parameters
Name Description
clazz Class<?>
connectionId String
Returns
Type Description
BigQueryJdbcResultSetLogger

Methods

fine(String msg)

public void fine(String msg)
Parameter
Name Description
msg String

fine(Supplier<String> msgSupplier)

public void fine(Supplier<String> msgSupplier)
Parameter
Name Description
msgSupplier Supplier<String>

fineTrace(String methodName, String msg)

public void fineTrace(String methodName, String msg)

Log at FINE with the class name and method name preset.

Parameters
Name Description
methodName String
msg String

fineTrace(String methodName, Supplier<String> msgSupplier)

public void fineTrace(String methodName, Supplier<String> msgSupplier)

Log a lazy message at FINE with the class name and method name preset.

Parameters
Name Description
methodName String
msgSupplier Supplier<String>

finer(String msg)

public void finer(String msg)
Parameter
Name Description
msg String

finer(Supplier<String> msgSupplier)

public void finer(Supplier<String> msgSupplier)
Parameter
Name Description
msgSupplier Supplier<String>

finerTrace(String methodName, String msg)

public void finerTrace(String methodName, String msg)

Log at FINER with the class name and method name preset.

Parameters
Name Description
methodName String
msg String

finerTrace(String methodName, Supplier<String> msgSupplier)

public void finerTrace(String methodName, Supplier<String> msgSupplier)

Log a lazy message at FINER with the class name and method name preset.

Parameters
Name Description
methodName String
msgSupplier Supplier<String>

finest(String msg)

public void finest(String msg)
Parameter
Name Description
msg String

finest(Supplier<String> msgSupplier)

public void finest(Supplier<String> msgSupplier)
Parameter
Name Description
msgSupplier Supplier<String>

finestTrace(String methodName)

public void finestTrace(String methodName)

Log at FINEST with the class name, method name and "++enter++" preset (no stack walk).

Parameter
Name Description
methodName String

finestTrace(String methodName, String msg)

public void finestTrace(String methodName, String msg)

Log at FINEST with the class name and method name preset (no stack walk).

Parameters
Name Description
methodName String
msg String

finestTrace(String methodName, Supplier<String> msgSupplier)

public void finestTrace(String methodName, Supplier<String> msgSupplier)

Log a lazy message at FINEST with the class name and method name preset.

Parameters
Name Description
methodName String
msgSupplier Supplier<String>

getArrowArrayLogger()

public BigQueryJdbcResultSetLogger getArrowArrayLogger()
Returns
Type Description
BigQueryJdbcResultSetLogger

getArrowStructLogger()

public BigQueryJdbcResultSetLogger getArrowStructLogger()
Returns
Type Description
BigQueryJdbcResultSetLogger

getConnectionId()

public String getConnectionId()
Returns
Type Description
String

getJsonArrayLogger()

public BigQueryJdbcResultSetLogger getJsonArrayLogger()
Returns
Type Description
BigQueryJdbcResultSetLogger

getJsonStructLogger()

public BigQueryJdbcResultSetLogger getJsonStructLogger()
Returns
Type Description
BigQueryJdbcResultSetLogger

isLoggable(Level level)

public boolean isLoggable(Level level)
Parameter
Name Description
level Level
Returns
Type Description
boolean

log(LogRecord record)

public void log(LogRecord record)

Stamps the connection ID into params[0] and forwards to the shared logger. Does not touch the record's source class/method: hot-path callers set them explicitly, and cold-path callers (severe, warning) rely on BigQueryJdbcCustomLogger.BigQueryJdbcLogRecord to infer them lazily.

Parameter
Name Description
record LogRecord

severe(String msg, Throwable thrown)

public void severe(String msg, Throwable thrown)
Parameters
Name Description
msg String
thrown Throwable

warning(String format, Object[] args)

public void warning(String format, Object[] args)
Parameters
Name Description
format String
args Object[]