Class MockServerLogger
- Author:
- jamesdbloom
-
Constructor Summary
ConstructorsConstructorDescriptionMockServerLogger(Class<?> loggerClass) MockServerLogger(Configuration configuration, Class<?> loggerClass) MockServerLogger(Configuration configuration, HttpState httpStateHandler) MockServerLogger(Configuration configuration, org.slf4j.Logger logger) MockServerLogger(HttpState httpStateHandler) MockServerLogger(org.slf4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidTheConfigurationthis logger was constructed with, ornullwhen it was built without one (test-support constructors, client-side use).booleanstatic booleanisEnabled(org.slf4j.event.Level level) static booleanisEnabled(org.slf4j.event.Level level, org.slf4j.event.Level configuredLevel) booleanisEnabledForInstance(org.slf4j.event.Level level) voidstatic voidsetGlobalLogEventListener(Consumer<LogEntry> listener) setHttpStateHandler(HttpState httpStateHandler) static voidwriteToSystemOut(org.slf4j.Logger logger, LogEntry logEntry) static voidwriteToSystemOut(org.slf4j.Logger logger, LogEntry logEntry, Configuration configuration)
-
Constructor Details
-
MockServerLogger
public MockServerLogger() -
MockServerLogger
public MockServerLogger(org.slf4j.Logger logger) -
MockServerLogger
-
MockServerLogger
-
MockServerLogger
-
MockServerLogger
-
MockServerLogger
-
-
Method Details
-
configureLogger
public static void configureLogger() -
getConfiguration
TheConfigurationthis logger was constructed with, ornullwhen it was built without one (test-support constructors, client-side use).Exposed because
MockServerLoggeris already the configuration carrier threaded through the whole matcher graph: matchers such asRegexStringMatcher,XPathMatcherandJsonStringMatcher— and the sharedMatchingTimeoutExecutor— are constructed with a logger and nothing else, yet must honour instance-scoped matching limits (regexMatchingTimeoutMillis,xpathMatchingTimeoutMillis,customJsonUnitMatchersClass) that are settable overPUT /mockserver/configuration. Reading the configuration off the logger they already hold avoids threading a second parameter through ~15 matcher construction sites for values those sites never otherwise touch.Callers MUST treat
nullas "no instance configured" and fall back toConfigurationProperties, exactly asisEnabledForInstance(Level)andisDisableLogging()already do. -
setHttpStateHandler
-
setGlobalLogEventListener
-
logEvent
-
isEnabledForInstance
public boolean isEnabledForInstance(org.slf4j.event.Level level) -
isDisableLogging
public boolean isDisableLogging() -
writeToSystemOut
public static void writeToSystemOut(org.slf4j.Logger logger, LogEntry logEntry, Configuration configuration) -
writeToSystemOut
-
isEnabled
public static boolean isEnabled(org.slf4j.event.Level level) -
isEnabled
public static boolean isEnabled(org.slf4j.event.Level level, org.slf4j.event.Level configuredLevel)
-