in services/library/src/main/java/com/google/cloud/pso/bq_snapshot_manager/helpers/LoggingHelper.java [222:261]
public void logUnified(
Boolean isDryRun,
String component,
String runId,
String trackingId,
@Nullable TableSpec targetTable,
@Nullable JsonMessage inputJson,
@Nullable JsonMessage outputJson,
boolean isSuccess,
@Nullable Exception exception,
boolean isRetryableError
){
Object [] attributes = new Object[]{
kv("unified_component", component),
kv("unified_run_id", runId),
kv("unified_tracking_id", trackingId),
kv("unified_target_table", targetTable != null? targetTable.toSqlString(): null),
kv("unified_input_json", inputJson != null? inputJson.toJsonString(): null),
kv("unified_output_json", outputJson != null? outputJson.toJsonString(): null),
kv("unified_is_successful", String.valueOf(isSuccess)),
kv("unified_error", exception != null? ExceptionUtils.getStackTrace(exception) : null),
kv("unified_is_retryable_error", String.valueOf(isRetryableError))
};
logWithTracker(
ApplicationLog.UNIFIED_LOG,
isDryRun,
trackingId,
targetTable,
String.format("Unified log event for component '%s' processing target table '%s' with isSuccess status = '%s' and isRetryable = '%s'",
component,
targetTable != null? targetTable.toSqlString(): "",
isSuccess,
isRetryableError
),
isSuccess || isRetryableError? Level.INFO : Level.ERROR,
attributes
);
}