changeset 1733:8b3ad1fb219f

make LogHandler configurable
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 14 Sep 2022 07:51:13 -0600
parents 8a6e48371c66
children 02d2a6c3bc6f
files src/goodjava/webserver/handlers/LogHandler.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/goodjava/webserver/handlers/LogHandler.java	Mon Sep 12 19:13:13 2022 -0400
+++ b/src/goodjava/webserver/handlers/LogHandler.java	Wed Sep 14 07:51:13 2022 -0600
@@ -21,13 +21,14 @@
 
 
 public final class LogHandler implements Handler {
-	private static final Layout layout = new ListLayout(new DateLayout("yyyy-MM-dd:HH:mm:ss")," ",Layouts.MESSAGE,"\n");
+	public static int level = Level.INFO;
+	public static Layout layout = new ListLayout(new DateLayout("yyyy-MM-dd:HH:mm:ss")," ",Layouts.MESSAGE,"\n");
 
 	public static Logger consoleLogger() {
 		Appender appender = new ConsoleAppender(layout,System.err);
 		GoodLogger logger = new GoodLogger("HTTP");
 		logger.appender = appender;
-		logger.level = Level.INFO;
+		logger.level = level;
 		return logger;
 	}
 
@@ -44,7 +45,7 @@
 		appender.deleteAfter = deleteAfter;
 		GoodLogger logger = new GoodLogger("HTTP");
 		logger.appender = appender;
-		logger.level = Level.INFO;
+		logger.level = level;
 		return logger;
 	}