Skip to content

Commit f2e04a5

Browse files
authored
#56 Use readable debug log files (#60)
1 parent 159ba99 commit f2e04a5

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ This module redirects the STDOUT from UDFs to files on the test host.
8484
You can find the logs in `target/udf-logs/`. For each incoming stream (UDF instance) this module creates one file and logs its name:
8585

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

9090
## Known Issue: Failing Integration Tests on Windows

doc/changes/changes_0.6.10.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
# Udf Debugging Java 0.6.10, released 2023-??-??
1+
# Udf Debugging Java 0.6.10, released 2023-07-05
22

33
Code name: Reduce dependencies
44

55
## Summary
66

7-
This release replaces code that causes an unnecessary dependency on slf4j-api.
7+
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`.
8+
9+
## Features
10+
11+
* #56: Used readable and sortable names for UDF debug log files.
812

913
## Refactoring
1014

src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.net.ServerSocket;
55
import java.net.Socket;
66
import java.nio.file.*;
7+
import java.time.Instant;
78
import java.util.function.Consumer;
89

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

0 commit comments

Comments
 (0)