Package com.persequor.extension.logging
Interface ISagaLogger
- All Known Implementing Classes:
SagaLogger
public interface ISagaLogger
ISagaLogger is the main interface for logging in Saga SDK. It is expected that logging takes place through concrete implementations of this interface.
Typical usage pattern:
import com.persequor.extension.logging.ISagaLogger; import com.persequor.extension.logging.LoggingCategory; import com.persequor.extension.logging.LoggingContext; import com.persequor.extension.logging.LoggingMessage; public class LoggingExampleController { private ISagaLogger logger = sagaLoggerFactory.get(getClass()); public void helloWithCustomLoggingContext() { // this logging will override LoggingContext provided when getting an instance of ISagaLogger from the factory logger.info(LoggingCategory.SYSTEM, LoggingContext.CORE, LoggingMessage.of("hello from custom context"), LoggingMessage.of("our Recomendation")); } }
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
debug
(ISagaLogRecord baseLogging) Log a message at the DEBUG level according to the implementation of the interfaceISagaLogRecord
default void
debug
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage) Log a message at the DEBUG level according to the logging category, logging context, message and recommendation messagedefault void
debug
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, AdditionalLoggingData additionalContext) Wrapper fordebug(LoggingContext, LoggingCategory, LoggingMessage)
that allows for additional context to be passed to the logger.void
debug
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, Throwable throwable) Log a message at the DEBUG level according to the logging category, logging context and messagevoid
debug
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, Throwable throwable, AdditionalLoggingData additionalContext) Wrapper fordebug(LoggingContext, LoggingCategory, LoggingMessage, Throwable)
that allows for additional context to be passed to the logger.default void
error
(ISagaLogRecord baseLogging) Log a message at the ERROR level according to the implementation of the interfaceISagaLogRecord
default void
error
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation) Log a message at the ERROR level according to the logging category, logging context, message and recommendation messagedefault void
error
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, AdditionalLoggingData additionalContext) Wrapper forerror(LoggingContext, LoggingCategory, LoggingMessage, LoggingMessage)
that allows for additional context to be passed to the logger.void
error
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, Throwable throwable) Log a message at the ERROR level according to the logging category, logging context, message and recommendation messagevoid
error
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, Throwable throwable, AdditionalLoggingData additionalContext) Wrapper forerror(LoggingContext, LoggingCategory, LoggingMessage, LoggingMessage, Throwable)
that allows for additional context to be passed to the logger.default void
info
(ISagaLogRecord baseLogging) Log a message at the INFO level according to the implementation of the interfaceISagaLogRecord
default void
info
(LoggingContext context, LoggingCategory category, LoggingMessage message) Log a message at the INFO level according to the logging category, logging context, message and recommendation messagedefault void
info
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, AdditionalLoggingData additionalContext) Wrapper forinfo(LoggingContext, LoggingCategory, LoggingMessage)
that allows for additional context to be passed to the logger.void
info
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, Throwable throwable) Log a message at the INFO level according to the logging category, logging context, message and recommendation messagevoid
info
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, Throwable throwable, AdditionalLoggingData additionalContext) Wrapper forinfo(LoggingContext, LoggingCategory, LoggingMessage, Throwable)
that allows for additional context to be passed to the logger.default void
trace
(ISagaLogRecord logRecord) Log a message at the TRACE level according to the implementation of the interfaceISagaLogRecord
default void
trace
(LoggingContext context, LoggingCategory category, LoggingMessage message) Log a message at the TRACE level according to the logging category, logging context, message and recommendation messagedefault void
trace
(LoggingContext context, LoggingCategory category, LoggingMessage message, AdditionalLoggingData additionalContext) Wrapper fortrace(LoggingContext, LoggingCategory, LoggingMessage)
that allows for additional context to be passed to the logger.void
trace
(LoggingContext context, LoggingCategory category, LoggingMessage message, Throwable throwable) Log a message at the TRACE level according to the logging category, logging context, message and recommendation messagevoid
trace
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, Throwable throwable, AdditionalLoggingData additionalContext) Wrapper fortrace(LoggingContext, LoggingCategory, LoggingMessage, Throwable)
that allows for additional context to be passed to the logger.default void
warn
(ISagaLogRecord baseLogging) Log a message at the WARN level according to the implementation of the interfaceISagaLogRecord
default void
warn
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation) Log a message at the WARN level according to the logging category, logging context, message and recommendation messagedefault void
warn
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, AdditionalLoggingData additionalContext) Wrapper forwarn(LoggingContext, LoggingCategory, LoggingMessage, LoggingMessage)
that allows for additional context to be passed to the logger.void
warn
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, Throwable throwable) Log a message at the WARN level according to the logging category, logging context, message and recommendation messagevoid
warn
(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, Throwable throwable, AdditionalLoggingData additionalContext) Wrapper forwarn(LoggingContext, LoggingCategory, LoggingMessage, LoggingMessage, Throwable)
that allows for additional context to be passed to the logger.withContext
(LoggingContext context) Provides aISagaLoggerWithContext
instance based on the current class with a predefined context allowing the developer to use a logger without having to specify the same context over and over.
-
Method Details
-
trace
Log a message at the TRACE level according to the logging category, logging context, message and recommendation message- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
-
trace
void trace(LoggingContext context, LoggingCategory category, LoggingMessage message, Throwable throwable) Log a message at the TRACE level according to the logging category, logging context, message and recommendation message- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
throwable
- a throwableThrowable
-
trace
default void trace(LoggingContext context, LoggingCategory category, LoggingMessage message, AdditionalLoggingData additionalContext) Wrapper fortrace(LoggingContext, LoggingCategory, LoggingMessage)
that allows for additional context to be passed to the logger.- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
additionalContext
- the additional contextAdditionalLoggingData
- See Also:
-
trace
Log a message at the TRACE level according to the implementation of the interfaceISagaLogRecord
- Parameters:
logRecord
- interface ofISagaLogRecord
-
trace
void trace(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, Throwable throwable, AdditionalLoggingData additionalContext) Wrapper fortrace(LoggingContext, LoggingCategory, LoggingMessage, Throwable)
that allows for additional context to be passed to the logger.- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
throwable
- a throwableThrowable
additionalContext
- the additional contextAdditionalLoggingData
- See Also:
-
debug
default void debug(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage) Log a message at the DEBUG level according to the logging category, logging context, message and recommendation message- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
-
debug
void debug(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, Throwable throwable) Log a message at the DEBUG level according to the logging category, logging context and message- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
throwable
- a throwableThrowable
-
debug
default void debug(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, AdditionalLoggingData additionalContext) Wrapper fordebug(LoggingContext, LoggingCategory, LoggingMessage)
that allows for additional context to be passed to the logger.- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
additionalContext
- the additional contextAdditionalLoggingData
- See Also:
-
debug
Log a message at the DEBUG level according to the implementation of the interfaceISagaLogRecord
- Parameters:
baseLogging
- interface ofISagaLogRecord
-
debug
void debug(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, Throwable throwable, AdditionalLoggingData additionalContext) Wrapper fordebug(LoggingContext, LoggingCategory, LoggingMessage, Throwable)
that allows for additional context to be passed to the logger.- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
throwable
- a throwableThrowable
additionalContext
- the additional contextAdditionalLoggingData
- See Also:
-
info
Log a message at the INFO level according to the logging category, logging context, message and recommendation message- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
-
info
void info(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, Throwable throwable) Log a message at the INFO level according to the logging category, logging context, message and recommendation message- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
throwable
- a throwableThrowable
-
info
default void info(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, AdditionalLoggingData additionalContext) Wrapper forinfo(LoggingContext, LoggingCategory, LoggingMessage)
that allows for additional context to be passed to the logger.- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
additionalContext
- the additional contextAdditionalLoggingData
- See Also:
-
info
Log a message at the INFO level according to the implementation of the interfaceISagaLogRecord
- Parameters:
baseLogging
- interface ofISagaLogRecord
-
info
void info(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, Throwable throwable, AdditionalLoggingData additionalContext) Wrapper forinfo(LoggingContext, LoggingCategory, LoggingMessage, Throwable)
that allows for additional context to be passed to the logger.- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
throwable
- a throwableThrowable
additionalContext
- the additional contextAdditionalLoggingData
- See Also:
-
warn
default void warn(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation) Log a message at the WARN level according to the logging category, logging context, message and recommendation message- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
-
warn
void warn(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, Throwable throwable) Log a message at the WARN level according to the logging category, logging context, message and recommendation message- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
throwable
- a throwableThrowable
-
warn
Log a message at the WARN level according to the implementation of the interfaceISagaLogRecord
- Parameters:
baseLogging
- interface ofISagaLogRecord
-
warn
void warn(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, Throwable throwable, AdditionalLoggingData additionalContext) Wrapper forwarn(LoggingContext, LoggingCategory, LoggingMessage, LoggingMessage, Throwable)
that allows for additional context to be passed to the logger.- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
throwable
- a throwableThrowable
additionalContext
- the additional contextAdditionalLoggingData
- See Also:
-
warn
default void warn(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, AdditionalLoggingData additionalContext) Wrapper forwarn(LoggingContext, LoggingCategory, LoggingMessage, LoggingMessage)
that allows for additional context to be passed to the logger.- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
additionalContext
- the additional contextAdditionalLoggingData
- See Also:
-
error
default void error(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation) Log a message at the ERROR level according to the logging category, logging context, message and recommendation message- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
-
error
void error(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, Throwable throwable) Log a message at the ERROR level according to the logging category, logging context, message and recommendation message- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
throwable
- a throwableThrowable
-
error
default void error(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, AdditionalLoggingData additionalContext) Wrapper forerror(LoggingContext, LoggingCategory, LoggingMessage, LoggingMessage)
that allows for additional context to be passed to the logger.- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
additionalContext
- the additional contextAdditionalLoggingData
- See Also:
-
error
Log a message at the ERROR level according to the implementation of the interfaceISagaLogRecord
- Parameters:
baseLogging
- interface ofISagaLogRecord
-
error
void error(LoggingContext context, LoggingCategory category, LoggingMessage templatedMessage, LoggingMessage recommendation, Throwable throwable, AdditionalLoggingData additionalContext) Wrapper forerror(LoggingContext, LoggingCategory, LoggingMessage, LoggingMessage, Throwable)
that allows for additional context to be passed to the logger.- Parameters:
context
- the logging contextLoggingContext
category
- the logging categoryLoggingCategory
templatedMessage
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
additionalContext
- the additional contextAdditionalLoggingData
throwable
- a throwableThrowable
- See Also:
-
withContext
Provides aISagaLoggerWithContext
instance based on the current class with a predefined context allowing the developer to use a logger without having to specify the same context over and over.- Parameters:
context
- the logging contextLoggingContext
- Returns:
- a logger with a default context.
- See Also:
-