Log system v2

This commit is contained in:
Louis Calas 2019-10-09 15:06:48 +02:00
parent ac6142ccd9
commit a8efeb5c18
3 changed files with 20 additions and 42 deletions

View File

@ -18,49 +18,21 @@ appender.file.layout.pattern=[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} -
#Création des loggers #Création des loggers
loggers = console, f, e, w, i, d loggers = console, commands, csv
logger.f.name = fatalLogger logger.csv.name = csv
logger.f.level = fatal logger.csv.level = fatal
logger.f.additivity = false logger.csv.additivity = false
logger.f.appenderRefs = console logger.csv.appenderRefs = console
logger.f.appenderRef.console.ref = STDOUT logger.csv.appenderRef.console.ref = STDOUT
logger.f.appenderRef.file.ref = LOGFILE logger.csv.appenderRef.file.ref = LOGFILE
logger.e.name = errorLogger logger.commands.name = commands
logger.e.level = error logger.commands.level = fatal
logger.e.additivity = false logger.commands.additivity = false
logger.e.appenderRefs = console logger.commands.appenderRefs = console
logger.e.appenderRef.console.ref = STDOUT logger.commands.appenderRef.console.ref = STDOUT
logger.e.appenderRef.file.ref = LOGFILE logger.commands.appenderRef.file.ref = LOGFILE
logger.w.name = warnLogger
logger.w.level = warn
logger.w.additivity = false
logger.w.appenderRefs = console
logger.w.appenderRef.console.ref = STDOUT
logger.w.appenderRef.file.ref = LOGFILE
logger.i.name = infoLogger
logger.i.level = info
logger.i.additivity = false
logger.i.appenderRefs = console
logger.i.appenderRef.console.ref = STDOUT
logger.i.appenderRef.file.ref = LOGFILE
logger.d.name = debugLogger
logger.d.level = debug
logger.d.additivity = false
logger.d.appenderRefs = console
logger.d.appenderRef.console.ref = STDOUT
logger.d.appenderRef.file.ref = LOGFILE
logger.console.name = commands
logger.console.level = fatal
logger.console.additivity = false
logger.console.appenderRefs = console
logger.console.appenderRef.console.ref = STDOUT
logger.console.appenderRef.file.ref = LOGFILE
logger.console.name = log4j logger.console.name = log4j
logger.console.level = warn logger.console.level = warn

View File

@ -79,18 +79,23 @@ public class Read implements Callable <Void> {
if (vb_level >= 0 && vb_level <=2) { if (vb_level >= 0 && vb_level <=2) {
Configurator.setLevel("commands", Level.FATAL); Configurator.setLevel("commands", Level.FATAL);
Configurator.setLevel("csv", Level.FATAL);
} }
else if (vb_level >= 3 && vb_level <=4) { else if (vb_level >= 3 && vb_level <=4) {
Configurator.setLevel("commands", Level.ERROR); Configurator.setLevel("commands", Level.ERROR);
Configurator.setLevel("csv", Level.ERROR);
} }
else if (vb_level >= 5 && vb_level <=6) { else if (vb_level >= 5 && vb_level <=6) {
Configurator.setLevel("commands", Level.WARN); Configurator.setLevel("commands", Level.WARN);
Configurator.setLevel("csv", Level.WARN);
} }
else if (vb_level >= 7 && vb_level <=8) { else if (vb_level >= 7 && vb_level <=8) {
Configurator.setLevel("commands", Level.INFO); Configurator.setLevel("commands", Level.INFO);
Configurator.setLevel("csv", Level.INFO);
} }
else { else {
Configurator.setLevel("commands", Level.DEBUG); Configurator.setLevel("commands", Level.DEBUG);
Configurator.setLevel("csv", Level.DEBUG);
} }
// Help genere de la commande // Help genere de la commande

View File

@ -22,6 +22,7 @@ public class GenerateCSV {
this.path = path + "/" + pth; this.path = path + "/" + pth;
} }
// Teste validité du numero etudiant (selon param de la config passé : // Teste validité du numero etudiant (selon param de la config passé :
// numLength) // numLength)
@ -75,7 +76,7 @@ public class GenerateCSV {
writer.write(etud + ";" + etudiants.get(etud) + System.getProperty("line.separator")); writer.write(etud + ";" + etudiants.get(etud) + System.getProperty("line.separator"));
//} //}
// else { // else {
// logger.debug("Invalid not added to csv"); // logger.debug("Invalid id not added to csv");
// } // }
} else { } else {