com.azure.cosmos.spark.diagnostics.DiagnosticsProvider.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-cosmos-spark_3-2_2-12 Show documentation
Show all versions of azure-cosmos-spark_3-2_2-12 Show documentation
OLTP Spark 3.2 Connector for Azure Cosmos DB SQL API
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.spark.diagnostics
private[spark] trait DiagnosticsProvider {
def getLogger(classType: Class[_]) : ILogger
}
// minimal slf4j logger
private[spark] class DefaultDiagnostics extends DiagnosticsProvider {
override def getLogger(classType: Class[_]): ILogger = new DefaultMinimalSlf4jLogger(classType)
}
// only when diagnostics enabled,
// - logs each individual writes success and/or failures with id,pk
// - logs each documentServiceRequest and documentServiceResponse
private[spark] class SimpleDiagnosticsProvider extends DiagnosticsProvider {
override def getLogger(classType: Class[_]): ILogger = new SimpleDiagnosticsSlf4jLogger(classType)
}
// only when diagnostics enabled,
// - logs each FeedResponse when it is retrieved and processed
private[spark] class FeedDiagnosticsProvider extends DiagnosticsProvider {
override def getLogger(classType: Class[_]): ILogger = new FeedDiagnosticsSlf4jLogger(classType, false)
}
// only when diagnostics enabled,
// - logs each FeedResponse when it is retrieved and processed including list of pk and id values
private[spark] class DetailedFeedDiagnosticsProvider extends DiagnosticsProvider {
override def getLogger(classType: Class[_]): ILogger = new FeedDiagnosticsSlf4jLogger(classType, true)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy