Skip to content

Commit

Permalink
FEAT : CDE-195-creer-consumer-pour-generer-les-2-fichiers-de-log
Browse files Browse the repository at this point in the history
     - ajout de la création à la volée du répertoire tempLog
  • Loading branch information
EryneKL committed Oct 4, 2023
1 parent 283c70c commit 2fe40c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/fr/abes/logskbart/kafka/LogsListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ public void listenInfoKbart2KafkaAndErrorKbart2Kafka(ConsumerRecord<String, Stri
LocalDateTime time = LocalDateTime.now();
DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd-HH-mm-ss", Locale.FRANCE);
String date = format.format(time);

String tempLog = "tempLog/";
Files.createDirectory(Paths.get(tempLog));
Path target = Path.of("tempLog\\" + date + "_" + source);

Files.move(source, target, StandardCopyOption.REPLACE_EXISTING);
Expand Down

0 comments on commit 2fe40c8

Please sign in to comment.