[FIX] system.out removing to use all time LOGGER

This commit is contained in:
Edouard DUPIN 2025-01-05 21:40:39 +01:00
parent ee831283d3
commit ea8e2cc452
4 changed files with 14 additions and 11 deletions

View File

@ -99,7 +99,7 @@ public class WebLauncher {
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
public void run() {
System.out.println("Stopping server..");
WebLauncher.LOGGER.info("Stopping server..");
serverLink.shutdownNow();
}
}, "shutdownHook"));

View File

@ -2,14 +2,17 @@ package org.kar.archidata;
import org.kar.archidata.tools.ConfigBaseVariable;
import org.kar.archidata.tools.JWTWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class UpdateJwtPublicKey extends Thread {
private static final Logger LOGGER = LoggerFactory.getLogger(UpdateJwtPublicKey.class);
boolean kill = false;
@Override
public void run() {
if (ConfigBaseVariable.getSSOAddress() == null) {
System.out.println("SSO INTERFACE is not provided ==> work alone.");
LOGGER.warn("SSO INTERFACE is not provided ==> work alone.");
// No SO provided, kill the thread.
return;
}
@ -19,7 +22,7 @@ public class UpdateJwtPublicKey extends Thread {
JWTWrapper.initLocalTokenRemote(ConfigBaseVariable.getSSOAddress(), "archidata");
} catch (final Exception e1) {
e1.printStackTrace();
System.out.println("Can not retreive the basic tocken");
LOGGER.error("Can not retreive the basic tocken");
return;
}
try {

View File

@ -529,7 +529,7 @@ public class DBAccessMorphia extends DBAccess {
final Document insertedDocument = collection.find(new Document("_id", insertedId)).first();
// Afficher le document récupéré
System.out.println("Inserted document: " + insertedDocument);
LOGGER.trace("Inserted document: " + insertedDocument);
} catch (final Exception ex) {
LOGGER.error("Fail SQL request: {}", ex.getMessage());

View File

@ -68,22 +68,22 @@ public class WebLauncher {
public void plop(final String aaa) {
// List available Image Readers
System.out.println("Available Image Readers:");
WebLauncher.LOGGER.trace("Available Image Readers:");
final Iterator<ImageReader> readers = ImageIO.getImageReadersByFormatName(aaa);
while (readers.hasNext()) {
final ImageReader reader = readers.next();
System.out.println("Reader: " + reader.getOriginatingProvider().getDescription(null));
System.out.println("Reader CN: " + reader.getOriginatingProvider().getPluginClassName());
WebLauncher.LOGGER.trace("Reader: " + reader.getOriginatingProvider().getDescription(null));
WebLauncher.LOGGER.trace("Reader CN: " + reader.getOriginatingProvider().getPluginClassName());
// ImageIO.deregisterServiceProvider(reader.getOriginatingProvider());
}
// List available Image Writers
System.out.println("\nAvailable Image Writers:");
WebLauncher.LOGGER.trace("\nAvailable Image Writers:");
final Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName(aaa);
while (writers.hasNext()) {
final ImageWriter writer = writers.next();
System.out.println("Writer: " + writer.getOriginatingProvider().getDescription(null));
System.out.println("Writer CN: " + writer.getOriginatingProvider().getPluginClassName());
WebLauncher.LOGGER.trace("Writer: " + writer.getOriginatingProvider().getDescription(null));
WebLauncher.LOGGER.trace("Writer CN: " + writer.getOriginatingProvider().getPluginClassName());
}
}
@ -135,7 +135,7 @@ public class WebLauncher {
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
public void run() {
System.out.println("Stopping server..");
LOGGER.warn("Stopping server..");
serverLink.shutdownNow();
}
}, "shutdownHook"));