diff --git a/sample/archidata/basic/WebLauncher.java b/sample/archidata/basic/WebLauncher.java index ab08261..b28e82c 100755 --- a/sample/archidata/basic/WebLauncher.java +++ b/sample/archidata/basic/WebLauncher.java @@ -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")); diff --git a/src/org/kar/archidata/UpdateJwtPublicKey.java b/src/org/kar/archidata/UpdateJwtPublicKey.java index 379a61b..3bcb02e 100644 --- a/src/org/kar/archidata/UpdateJwtPublicKey.java +++ b/src/org/kar/archidata/UpdateJwtPublicKey.java @@ -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 { diff --git a/src/org/kar/archidata/dataAccess/DBAccessMorphia.java b/src/org/kar/archidata/dataAccess/DBAccessMorphia.java index 1c13577..dc7f4f5 100644 --- a/src/org/kar/archidata/dataAccess/DBAccessMorphia.java +++ b/src/org/kar/archidata/dataAccess/DBAccessMorphia.java @@ -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()); diff --git a/test/src/test/kar/archidata/apiExtern/WebLauncher.java b/test/src/test/kar/archidata/apiExtern/WebLauncher.java index ec7db65..3f7804d 100755 --- a/test/src/test/kar/archidata/apiExtern/WebLauncher.java +++ b/test/src/test/kar/archidata/apiExtern/WebLauncher.java @@ -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 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 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"));