diff src/luan/host/WebHandler.java @ 1454:219f2b937f2b

remove log4j
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 08 Mar 2020 14:11:30 -0600
parents b6030fa18839
children e66e3d50b289
line wrap: on
line diff
--- a/src/luan/host/WebHandler.java	Mon Mar 02 15:09:10 2020 -0700
+++ b/src/luan/host/WebHandler.java	Sun Mar 08 14:11:30 2020 -0600
@@ -14,7 +14,7 @@
 import luan.LuanClosure;
 import luan.LuanRuntimeException;
 import luan.modules.http.LuanHandler;
-import luan.modules.logging.Log4j;
+import luan.modules.logging.LuanLogger;
 
 
 public class WebHandler implements Handler {
@@ -31,7 +31,6 @@
 			new File(logDir).mkdirs();
 
 			Luan luan = new Luan();
-			Log4j.newLoggerRepository(luan);
 			initLuan(luan,dirStr,domain);
 			return new LuanHandler(luan,domain);
 		}
@@ -47,6 +46,7 @@
 		if( !new File(dir).exists() )
 			throw new RuntimeException();
 		sitesDir = dir;
+		LuanLogger.initThreadLogging();
 	}
 
 	@Override public Response handle(Request request) {
@@ -59,11 +59,14 @@
 	}
 
 	private static void initLuan(Luan luan,String dir,String domain) {
+		LuanLogger.startThreadLogging(luan);
 		try {
 			LuanFunction fn = Luan.loadClasspath(luan,"luan/host/init.luan");
 			fn.call(dir,domain);
 		} catch(LuanException e) {
 			throw new LuanRuntimeException(e);
+		} finally {
+			LuanLogger.endThreadLogging();
 		}
 		security(luan,dir);
 	}