Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UDF logging #100

Merged
merged 11 commits into from
Aug 14, 2024
6 changes: 3 additions & 3 deletions .github/workflows/ci-build.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions .project-keeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ build:
runnerOs: ubuntu-20.04
freeDiskSpace: true
exasolDbVersions:
- "8.24.0"
- "7.1.25"
- "8.29.1"
- "7.1.29"
excludes:
# Custom extension artifact
- "W-PK-CORE-153: Project-keeper version 4.1.0 is outdated. Please update project-keeper to latest version 4.2.0."
- "E-PK-CORE-18: Outdated content: '.github/workflows/release_droid_upload_github_release_assets.yml'"
46 changes: 23 additions & 23 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.generate.finalModifiers": "explicit",
"source.fixAll": "explicit"
},
"java.codeGeneration.useBlocks": true,
"java.saveActions.organizeImports": true,
"java.sources.organizeImports.starThreshold": 3,
"java.sources.organizeImports.staticStarThreshold": 3,
"java.test.config": {
"vmArgs": [
"-Djava.util.logging.config.file=src/test/resources/logging.properties"
]
},
"java.configuration.updateBuildConfiguration": "automatic",
"files.watcherExclude": {
"**/target": true
},
"sonarlint.connectedMode.project": {
"connectionId": "exasol",
"projectKey": "com.exasol:kafka-connector-extension"
}
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.generate.finalModifiers": "explicit",
"source.fixAll": "explicit"
},
"java.codeGeneration.useBlocks": true,
"java.saveActions.organizeImports": true,
"java.sources.organizeImports.starThreshold": 3,
"java.sources.organizeImports.staticStarThreshold": 3,
"java.test.config": {
"vmArgs": [
"-Djava.util.logging.config.file=src/test/resources/logging.properties"
]
},
"java.configuration.updateBuildConfiguration": "automatic",
"files.watcherExclude": {
"**/target": true
},
"sonarlint.connectedMode.project": {
"connectionId": "exasol",
"projectKey": "com.exasol:kafka-connector-extension"
}
}
253 changes: 127 additions & 126 deletions dependencies.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions doc/changes/changelog.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions doc/changes/changes_1.7.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Kafka Connector Extension 1.7.7, released 2024-??-??

Code name: Fix logging

## Summary

This release fixes logging of the UDF by adding required libraries. The log level is `WARN` by default and can be changed by rebuilding the adapter JAR. See the [Exasol documentation](https://docs.exasol.com/db/latest/database_concepts/udf_scripts/debug_udf_script_output.htm) for how to configure logging of UDFs.

## Features

* ISSUE_NUMBER: description

## Dependency Updates

### Exasol Kafka Connector Extension

#### Compile Dependency Updates

* Added `ch.qos.logback:logback-classic:1.5.6`
* Added `org.slf4j:slf4j-api:2.0.16`

#### Test Dependency Updates

* Removed `ch.qos.logback:logback-classic:1.5.3`
* Removed `ch.qos.logback:logback-core:1.5.3`
* Updated `com.exasol:exasol-testcontainers:7.0.1` to `7.1.1`
6 changes: 6 additions & 0 deletions doc/development/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ Please read the common [developer guide for the Scala projects][dev-guide].

[dev-guide]: https://github.com/exasol/import-export-udf-common-scala/blob/master/doc/development/developer_guide.md
[import-export-udf]: https://docs.exasol.com/loading_data/user_defined_import_export_using_udfs.htm

## Configure Logging

This project uses Logback for logging because third-party dependencies already use SLF4J. The log level is set to `WARN` by default to avoid performance overhead. For debugging you can increase the log level in [logback.xml](../../src/main/resources/logback.xml) and rebuild the adapter JAR.
kaklakariada marked this conversation as resolved.
Show resolved Hide resolved

See the [Exasol documentation](https://docs.exasol.com/db/latest/database_concepts/udf_scripts/debug_udf_script_output.htm) for how to enable log output for UDFs.
12 changes: 6 additions & 6 deletions doc/user_guide/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ checksum provided together with the jar file.
To check the SHA256 sum of the downloaded jar, run the command:

```sh
sha256sum exasol-kafka-connector-extension-1.7.6.jar
sha256sum exasol-kafka-connector-extension-1.7.7.jar
```

### Building From Source
Expand All @@ -84,7 +84,7 @@ sbt assembly
```

The packaged jar file should be located at
`target/scala-2.12/exasol-kafka-connector-extension-1.7.6.jar`.
`target/scala-2.12/exasol-kafka-connector-extension-1.7.7.jar`.

### Create an Exasol BucketFS Bucket

Expand All @@ -106,7 +106,7 @@ jar, please make sure the BucketFS ports are open.
Upload the jar file using the `curl` command:

```bash
curl -X PUT -T exasol-kafka-connector-extension-1.7.6.jar \
curl -X PUT -T exasol-kafka-connector-extension-1.7.7.jar \
http://w:<WRITE_PASSWORD>@<EXASOL_DATANODE>:2580/<BUCKET_NAME>/
```

Expand Down Expand Up @@ -135,12 +135,12 @@ OPEN SCHEMA KAFKA_EXTENSION;

CREATE OR REPLACE JAVA SET SCRIPT KAFKA_CONSUMER(...) EMITS (...) AS
%scriptclass com.exasol.cloudetl.kafka.KafkaConsumerQueryGenerator;
%jar /buckets/bfsdefault/<BUCKET>/exasol-kafka-connector-extension-1.7.6.jar;
%jar /buckets/bfsdefault/<BUCKET>/exasol-kafka-connector-extension-1.7.7.jar;
/

CREATE OR REPLACE JAVA SET SCRIPT KAFKA_IMPORT(...) EMITS (...) AS
%scriptclass com.exasol.cloudetl.kafka.KafkaTopicDataImporter;
%jar /buckets/bfsdefault/<BUCKET>/exasol-kafka-connector-extension-1.7.6.jar;
%jar /buckets/bfsdefault/<BUCKET>/exasol-kafka-connector-extension-1.7.7.jar;
/

CREATE OR REPLACE JAVA SET SCRIPT KAFKA_METADATA(
Expand All @@ -150,7 +150,7 @@ CREATE OR REPLACE JAVA SET SCRIPT KAFKA_METADATA(
)
EMITS (partition_index DECIMAL(18, 0), max_offset DECIMAL(36,0)) AS
%scriptclass com.exasol.cloudetl.kafka.KafkaTopicMetadataReader;
%jar /buckets/bfsdefault/<BUCKET>/exasol-kafka-connector-extension-1.7.6.jar;
%jar /buckets/bfsdefault/<BUCKET>/exasol-kafka-connector-extension-1.7.7.jar;
/
```

Expand Down
2 changes: 1 addition & 1 deletion pk_generated_parent.pom

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 14 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.exasol</groupId>
<artifactId>kafka-connector-extension</artifactId>
<version>1.7.6</version>
<version>1.7.7</version>
<name>Exasol Kafka Connector Extension</name>
<description>Exasol Kafka Extension for accessing Apache Kafka</description>
<url>https://github.com/exasol/kafka-connector-extension/</url>
Expand Down Expand Up @@ -111,6 +111,17 @@
<artifactId>guava</artifactId>
<version>33.1.0-jre</version>
</dependency>
<!-- Upgrade slf4j-api to allow using the latest logback version -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.16</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.6</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>org.scalatest</groupId>
Expand All @@ -133,7 +144,7 @@
<dependency>
<groupId>com.exasol</groupId>
<artifactId>exasol-testcontainers</artifactId>
<version>7.0.1</version>
<version>7.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -212,20 +223,6 @@
<version>9.4.54.v20240208</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Upgrade transitive dependency of org.apache.zookeeper:zookeeper to fix CVE-2023-6378 -->
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.5.3</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- Upgrade transitive dependency of org.apache.zookeeper:zookeeper to fix CVE-2023-6378 -->
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-streams-avro-serde</artifactId>
Expand Down Expand Up @@ -641,7 +638,7 @@
<parent>
<artifactId>kafka-connector-extension-generated-parent</artifactId>
<groupId>com.exasol</groupId>
<version>1.7.6</version>
<version>1.7.7</version>
<relativePath>pk_generated_parent.pom</relativePath>
</parent>
</project>
17 changes: 17 additions & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>

<configuration>
<import class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"/>
<import class="ch.qos.logback.core.ConsoleAppender"/>

<appender name="STDOUT" class="ConsoleAppender">
<encoder class="PatternLayoutEncoder">
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%kvp- %msg%n</pattern>
</encoder>
</appender>

<root level="warn">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
Loading