Interface StatementLogger
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Contract for handling database statement log events.
Implementations should be threadsafe.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionvoidlog(@NonNull StatementLog statementLog) Performs a logging operation on the givenstatementLog.
-
Method Details
-
log
Performs a logging operation on the givenstatementLog.Implementors might choose to no-op, write to stdout or a logging framework, send alerts about slow queries, and so on.
Unlike
MetricsCollectorfailures,StatementLoggerfailures are not silently discarded. If this method throws after a statement has otherwise completed successfully, the thrown exception propagates to the caller. Inside a Pyranid transaction, logger failures participate in normal transaction failure handling and cause rollback. If the statement itself already failed, the logger failure is attached as a suppressed exception to the primary failure.- Parameters:
statementLog- The event to log
-