Interface ISagaLoggerWithContext
- All Known Implementing Classes:
SagaLoggerWithContext
ISagaLoggerWithContext is the main interface for logging in Saga SDK with a pre defined context. 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 ISagaLoggerWithContext logger = sagaLoggerFactory.get(getClass(), LoggingContext.CORE); public void helloWithCustomLoggingContext() { // this logging will override LoggingContext provided when getting an instance of ISagaLogger from the factory logger.info(LoggingCategory.SYSTEM, LoggingMessage.get("hello from custom context"), LoggingMessage.get("our Recomendation")); } }
-
Method Summary
Modifier and TypeMethodDescriptiondefault ISagaLoggerWithContext
changeContext
(LoggingContext context) ProvidesISagaLoggerWithContext
instance allowing the developer to use a logger with a different context.default void
debug
(LoggingCategory category, LoggingMessage message) Log a message at the DEBUG level according to the logging category, logging context, message and recommendation messagevoid
debug
(LoggingCategory category, LoggingMessage message, Throwable throwable) Log a message at the DEBUG level according to the logging category, logging context, message and recommendation messagedefault void
error
(LoggingCategory category, LoggingMessage message, LoggingMessage recommendation) Log a message at the ERROR level according to the logging category, logging context, message and recommendation messagevoid
error
(LoggingCategory category, LoggingMessage message, LoggingMessage recommendation, Throwable throwable) Log a message at the ERROR level according to the logging category, logging context, message and recommendation messagedefault void
info
(LoggingCategory category, LoggingMessage message) Log a message at the INFO level according to the logging category, logging context, message and recommendation messagevoid
info
(LoggingCategory category, LoggingMessage message, Throwable throwable) Log a message at the INFO level according to the logging category, logging context, message and recommendation messagedefault void
trace
(LoggingCategory category, LoggingMessage message) Log a message at the TRACE level according to the logging category, logging context, message and recommendation messagevoid
trace
(LoggingCategory category, LoggingMessage message, Throwable throwable) Log a message at the TRACE level according to the logging category, logging context, message and recommendation messagedefault void
warn
(LoggingCategory category, LoggingMessage message, LoggingMessage recommendation) Log a message at the WARN level according to the logging category, logging context, message and recommendation messagevoid
warn
(LoggingCategory category, LoggingMessage message, LoggingMessage recommendation, Throwable throwable) Log a message at the WARN level according to the logging category, logging context, message and recommendation messageProvidesISagaLogger
instance allowing the developer to use a logger with a custom context.
-
Method Details
-
trace
Log a message at the TRACE level according to the logging category, logging context, message and recommendation message
- Parameters:
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
-
trace
Log a message at the TRACE level according to the logging category, logging context, message and recommendation message
- Parameters:
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
throwable
- a throwable to be loggedThrowable
-
debug
Log a message at the DEBUG level according to the logging category, logging context, message and recommendation message
- Parameters:
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
-
debug
Log a message at the DEBUG level according to the logging category, logging context, message and recommendation message
- Parameters:
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
throwable
- a throwable to be loggedThrowable
-
info
Log a message at the INFO level according to the logging category, logging context, message and recommendation message
- Parameters:
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
-
info
Log a message at the INFO level according to the logging category, logging context, message and recommendation message
- Parameters:
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
throwable
- a throwable to be loggedThrowable
-
warn
Log a message at the WARN level according to the logging category, logging context, message and recommendation message
- Parameters:
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
-
warn
void warn(LoggingCategory category, LoggingMessage message, LoggingMessage recommendation, Throwable throwable) Log a message at the WARN level according to the logging category, logging context, message and recommendation message
- Parameters:
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
throwable
- a throwable to be loggedThrowable
-
error
Log a message at the ERROR level according to the logging category, logging context, message and recommendation message
- Parameters:
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
-
error
void error(LoggingCategory category, LoggingMessage message, LoggingMessage recommendation, Throwable throwable) Log a message at the ERROR level according to the logging category, logging context, message and recommendation message
- Parameters:
category
- the logging categoryLoggingCategory
message
- the templated messageLoggingMessage
recommendation
- the recommendation messageLoggingMessage
throwable
- a throwable to be loggedThrowable
-
withoutContext
ISagaLogger withoutContext()Provides
ISagaLogger
instance allowing the developer to use a logger with a custom context.- Returns:
- an instance of
ISagaLogger
. - See Also:
-
changeContext
Provides
ISagaLoggerWithContext
instance allowing the developer to use a logger with a different context.- Returns:
- an instance of
ISagaLoggerWithContext
.
-