Class FileSdkLogger
java.lang.Object
com.sportradar.livedata.sdk.common.classes.BaseSdkLogger
com.sportradar.livedata.sdk.common.classes.FileSdkLogger
- All Implemented Interfaces:
SdkLogger
File SDK logger implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic Stringstatic final StringFields inherited from class com.sportradar.livedata.sdk.common.classes.BaseSdkLogger
alertLogger, clientInteractionLogger, invalidMessageLogger, logger, rootExecLogger, trafficLogger, usingLogback -
Constructor Summary
ConstructorsConstructorDescriptionFileSdkLogger(LoggerSettings loggerSettings, Timer timer) FileSdkLogger(LoggerSettings loggerSettings, Timer timer, String markerName) -
Method Summary
Modifier and TypeMethodDescriptionstatic SdkLogAppenderTypegetAppenderType(String appenderName) Return enum of typeSdkLogAppenderTypefrom a given appender name.static ch.qos.logback.classic.LevelbooleanisDebugEnabled(SdkLogAppenderType appenderType) Return true when logger with given appender type have current log level equal to debug, otherwise return false.booleanisErrorEnabled(SdkLogAppenderType appenderType) Return true when logger with given appender type have current log level equal to error, otherwise return false.booleanisInfoEnabled(SdkLogAppenderType appenderType) Return true when logger with given appender type have current log level equal to info, otherwise return false.booleanisLevelEnabled(ch.qos.logback.classic.Level level, SdkLogAppenderType appenderType) Return true when logger with given appender type have current log level equal to given level, otherwise false.booleanisTraceEnabled(SdkLogAppenderType appenderType) Return true when logger with given appender type have current log level equal to trace, otherwise return false.booleanisWarnEnabled(SdkLogAppenderType appenderType) Return true when logger with given appender type have current log level equal to warn, otherwise return false.protected voidvoidSDK will generate and signal alerts in case of any special events.voidSDK will generate and signal alerts in case of any special events.voidlogClientInteraction(ch.qos.logback.classic.Level level, String message) All interaction with the client software on the SDK interface level will be logged in a separate client communication log.voidlogClientInteraction(ch.qos.logback.classic.Level level, String message, Exception exception) All interaction with the client software on the SDK interface level will be logged in a separate client communication log.voidlogClientInteraction(ch.qos.logback.classic.Level level, String message, org.joda.time.Duration interval, Exception exception) All interaction with the client software on the SDK interface level will be logged in a separate client communication log.voidlogInvalidMessage(ch.qos.logback.classic.Level level, String message) Corrupt input feed data will be dumped into log files dedicated to corrupt input data (could be garbage and not even text, exceeding max buffer size).voidlogTraffic(boolean outgoing, String message) Depending on configuration SDK will be able to dump all feed XML traffic into dedicated traffic logs.voidlogTraffic(String message) Dump given message to traffic log.voidlogWithException(org.slf4j.Logger logger, ch.qos.logback.classic.Level level, String message, Exception exception)
-
Field Details
-
LOG_COMMON
- See Also:
-
LOG_SUFFIX
- See Also:
-
ZIP_SUFFIX
- See Also:
-
LOG_PATTERN
- See Also:
-
ROOT_NS
-
-
Constructor Details
-
FileSdkLogger
- Throws:
SdkException
-
FileSdkLogger
public FileSdkLogger(LoggerSettings loggerSettings, Timer timer, String markerName) throws SdkException - Throws:
SdkException
-
-
Method Details
-
getAppenderType
Return enum of typeSdkLogAppenderTypefrom a given appender name.- Parameters:
appenderName- specified appender type name- Returns:
- appender type of type
SdkLogAppenderTypefrom given appender name
-
getLevel
-
isDebugEnabled
Return true when logger with given appender type have current log level equal to debug, otherwise return false.- Specified by:
isDebugEnabledin interfaceSdkLogger- Parameters:
appenderType- specified appender type- Returns:
- true when logger with appender type have current level equal to debug, otherwise false
-
isErrorEnabled
Return true when logger with given appender type have current log level equal to error, otherwise return false.- Specified by:
isErrorEnabledin interfaceSdkLogger- Parameters:
appenderType- specified appender type- Returns:
- true when logger with appender type have current level equal to error, otherwise false
-
isInfoEnabled
Return true when logger with given appender type have current log level equal to info, otherwise return false.- Specified by:
isInfoEnabledin interfaceSdkLogger- Parameters:
appenderType- specified appender type- Returns:
- true when logger with appender type have current level equal to info, otherwise false
-
isLevelEnabled
Return true when logger with given appender type have current log level equal to given level, otherwise false.- Specified by:
isLevelEnabledin interfaceSdkLogger- Parameters:
level- specified levelappenderType- specified appender type- Returns:
truewhen logger with appender type have current level equal to level, otherwisefalse
-
isTraceEnabled
Return true when logger with given appender type have current log level equal to trace, otherwise return false.- Specified by:
isTraceEnabledin interfaceSdkLogger- Parameters:
appenderType- specified appender type- Returns:
- true when logger with appender type have current level equal to trace, otherwise false
-
isWarnEnabled
Return true when logger with given appender type have current log level equal to warn, otherwise return false.- Specified by:
isWarnEnabledin interfaceSdkLogger- Parameters:
appenderType- specified appender type- Returns:
- true when logger with appender type have current level equal to warn, otherwise false
-
logAlert
SDK will generate and signal alerts in case of any special events. This could happen when network connection is dropped, rate-limiting thresholds are exceeded, when going over queue low/high watermarks, when feed error recovery is in progress, if persistent state store gets out-of-sync, when event dispatching is put on pause, when SDK library is reloaded, current status of login sequence, etc. Alerts will be dumped into dedicated alert logs. Special alerts (configurable) could be logged to other log appenders, like SMTP appender, NT Event Log appender or JmxLogger appender. -
logAlert
SDK will generate and signal alerts in case of any special events. This could happen when network connection is dropped, rate-limiting thresholds are exceeded, when going over queue low/high watermarks, when feed error recovery is in progress, if persistent state store gets out-of-sync, when event dispatching is put on pause, when SDK library is reloaded, current status of login sequence, etc. Alerts will be dumped into dedicated alert logs. Special alerts (configurable) could be logged to other log appenders, like SMTP appender, NT Event Log appender or JmxLogger appender. -
logClientInteraction
All interaction with the client software on the SDK interface level will be logged in a separate client communication log. This includes all method invocations on the SDK interface including parameter values, request parameter validation errors and other errors returned by the SDK, unhandled client exceptions, errors reported by the client handlers, timings of each call, etc.- Specified by:
logClientInteractionin interfaceSdkLogger- Parameters:
level- Log levelmessage- String message
-
logClientInteraction
public void logClientInteraction(ch.qos.logback.classic.Level level, String message, Exception exception) Description copied from interface:SdkLoggerAll interaction with the client software on the SDK interface level will be logged in a separate client communication log. This includes all method invocations on the SDK interface including parameter values, request parameter validation errors and other errors returned by the SDK, unhandled client exceptions, errors reported by the client handlers, timings of each call, etc.- Specified by:
logClientInteractionin interfaceSdkLogger- Parameters:
level- Log levelmessage- String messageexception- Optional exception
-
logClientInteraction
public void logClientInteraction(ch.qos.logback.classic.Level level, String message, org.joda.time.Duration interval, Exception exception) Description copied from interface:SdkLoggerAll interaction with the client software on the SDK interface level will be logged in a separate client communication log. This includes all method invocations on the SDK interface including parameter values, request parameter validation errors and other errors returned by the SDK, unhandled client exceptions, errors reported by the client handlers, timings of each call, etc.- Specified by:
logClientInteractionin interfaceSdkLogger- Parameters:
level- Log levelmessage- String messageinterval- Elapsed time while processing client request or client handler invocation (optional)exception- Optional exception
-
logInvalidMessage
Corrupt input feed data will be dumped into log files dedicated to corrupt input data (could be garbage and not even text, exceeding max buffer size). Invalid input messages will be dumped into log files dedicated to invalid input messages (text, but not necessarily XML).- Specified by:
logInvalidMessagein interfaceSdkLogger- Parameters:
level- Log levelmessage- Invalid message
-
logTraffic
Depending on configuration SDK will be able to dump all feed XML traffic into dedicated traffic logs. This data is already logged at the feed server level but here the client will have possibility to configure traffic log filters based on the type of message, level of detail, match id, etc.- Specified by:
logTrafficin interfaceSdkLogger- Parameters:
outgoing- when true it specifies a message the SDK has sent; false means that a message SDK receivedmessage- Message that was either read or written to the communication channel
-
logTraffic
Dump given message to traffic log.- Specified by:
logTrafficin interfaceSdkLogger- Parameters:
message- Message that was either read or written to the channel
-
log
protected void log(ch.qos.logback.classic.Logger logger, ch.qos.logback.classic.Level level, String message) - Specified by:
login classBaseSdkLogger
-
logWithException
public void logWithException(org.slf4j.Logger logger, ch.qos.logback.classic.Level level, String message, Exception exception) - Specified by:
logWithExceptionin classBaseSdkLogger
-