Class KCLogger
- java.lang.Object
-
- com.snowflake.kafka.connector.internal.KCLogger
-
public class KCLogger extends Object
Logger for Snowflake Sink Connector. Attaches MDC's connector context if available
-
-
Field Summary
Fields Modifier and Type Field Description static StringMDC_CONN_CTX_KEY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(String format, Object... vars)Logs an debug level messagevoiderror(String format, Object... vars)Logs an error level messagevoidinfo(String format, Object... vars)Logs an info level messagestatic voidtoggleGlobalMdcLoggingContext(boolean shouldPrependMdcContext)Enable or disables the MDC context.voidtrace(String format, Object... vars)Logs an trace level messagevoidwarn(String format, Object... vars)Logs an warn level message
-
-
-
Field Detail
-
MDC_CONN_CTX_KEY
public static final String MDC_CONN_CTX_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
KCLogger
public KCLogger(String name)
Create and return a new logging handler- Parameters:
name- The class name passed for initializing the logger
-
-
Method Detail
-
toggleGlobalMdcLoggingContext
public static void toggleGlobalMdcLoggingContext(boolean shouldPrependMdcContext)
Enable or disables the MDC context. Only available for apache kafka versions after 2.3.0. https://cwiki.apache.org/confluence/display/KAFKA/KIP-449%3A+Add+connector+contexts+to+Connect+worker+logs- Parameters:
shouldPrependMdcContext- If all KC loggers should enable or disable MDC context
-
info
public void info(String format, Object... vars)
Logs an info level message- Parameters:
format- The message format without variablesvars- The variables to insert into the format. These variables will be toString()'ed
-
trace
public void trace(String format, Object... vars)
Logs an trace level message- Parameters:
format- The message format without variablesvars- The variables to insert into the format. These variables will be toString()'ed
-
debug
public void debug(String format, Object... vars)
Logs an debug level message- Parameters:
format- The message format without variablesvars- The variables to insert into the format. These variables will be toString()'ed
-
warn
public void warn(String format, Object... vars)
Logs an warn level message- Parameters:
format- The message format without variablesvars- The variables to insert into the format. These variables will be toString()'ed
-
-