Skip to content

Commit

Permalink
#56 Use readable debug log files (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Jul 5, 2023
1 parent 159ba99 commit f2e04a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This module redirects the STDOUT from UDFs to files on the test host.
You can find the logs in `target/udf-logs/`. For each incoming stream (UDF instance) this module creates one file and logs its name:

```
Created log file for UDF output: target/udf-logs/udf-log-16150321841745991713.txt
Created log file for UDF output: target/udf-logs/udf-log-2023-07-05T10:49:09.316547Z-576983159368731727.log
```

## Known Issue: Failing Integration Tests on Windows
Expand Down
8 changes: 6 additions & 2 deletions doc/changes/changes_0.6.10.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Udf Debugging Java 0.6.10, released 2023-??-??
# Udf Debugging Java 0.6.10, released 2023-07-05

Code name: Reduce dependencies

## Summary

This release replaces code that causes an unnecessary dependency on slf4j-api.
This release uses readable and sortable names for UDF debug log files written to `target/udf-logs/`. The release also replaces code that causes an unnecessary dependency on `slf4j-api`.

## Features

* #56: Used readable and sortable names for UDF debug log files.

## Refactoring

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.file.*;
import java.time.Instant;
import java.util.function.Consumer;

import com.exasol.errorreporting.ExaError;
Expand Down Expand Up @@ -94,7 +95,8 @@ private Logger(final Socket socket, final Consumer<Path> logFileHandler) {
@Override
public void run() {
try {
final Path logFile = Files.createTempFile(LOG_DIRECTORY, "udf-log-", ".txt");
final Path logFile = Files.createTempFile(LOG_DIRECTORY, "udf-log-" + Instant.now().toString() + "-",
".log");
this.logFileHandler.accept(logFile);
Files.copy(this.socket.getInputStream(), logFile, StandardCopyOption.REPLACE_EXISTING);
} catch (final IOException exception) {
Expand Down

0 comments on commit f2e04a5

Please sign in to comment.