use logger instead of system.out
This commit is contained in:
@@ -73,11 +73,11 @@ public class DataInitializer {
|
||||
return args -> {
|
||||
// Nur ausführen, wenn DB leer ist
|
||||
if (personRepo.count() > 0) {
|
||||
System.out.println("Datenbank enthält bereits Daten. Überspringe Initialisierung.");
|
||||
log.info("Datenbank enthält bereits Daten. Überspringe Initialisierung.");
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println("Generiere Testdaten...");
|
||||
log.info("Generiere Testdaten...");
|
||||
|
||||
// 1. Personen erstellen
|
||||
List<Person> persons = new ArrayList<>();
|
||||
@@ -138,7 +138,7 @@ public class DataInitializer {
|
||||
// Batch Save ist performanter
|
||||
docRepo.saveAll(documents);
|
||||
|
||||
System.out.println("Initialisierung abgeschlossen: 50 Personen und 500 Dokumente erstellt.");
|
||||
log.info("Initialisierung abgeschlossen: 50 Personen und 500 Dokumente erstellt.");
|
||||
};
|
||||
}
|
||||
private final String LOREM_IPSUM_LANG="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \n" + //
|
||||
|
||||
@@ -10,9 +10,12 @@ import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
@Configuration
|
||||
@Slf4j
|
||||
public class MinioConfig {
|
||||
|
||||
@Value("${app.s3.endpoint}")
|
||||
@@ -44,12 +47,12 @@ public class MinioConfig {
|
||||
@Bean
|
||||
public CommandLineRunner testS3Connection(S3Client s3Client) {
|
||||
return args -> {
|
||||
System.out.println("--- S3 VERBINDUNGSTEST START ---");
|
||||
log.info("--- S3 VERBINDUNGSTEST START ---");
|
||||
try {
|
||||
s3Client.listBuckets().buckets().forEach(b -> System.out.println("Gefundener Bucket: " + b.name()));
|
||||
System.out.println("--- S3 VERBINDUNGSTEST ERFOLGREICH ---");
|
||||
s3Client.listBuckets().buckets().forEach(b -> log.info("Gefundener Bucket: " + b.name()));
|
||||
log.info("--- S3 VERBINDUNGSTEST ERFOLGREICH ---");
|
||||
} catch (Exception e) {
|
||||
System.err.println("--- S3 FEHLER: " + e.getMessage());
|
||||
log.error("--- S3 FEHLER: " + e.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@ public class DocumentSpecifications {
|
||||
// Filtert nach Schlagworten (UND-Verknüpfung)
|
||||
public static Specification<Document> hasTags(List<String> tags) {
|
||||
return (root, query, cb) -> {
|
||||
System.out.println(tags);
|
||||
if (tags == null || tags.isEmpty())
|
||||
return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user