From 22f189a883e5e86860d7e831c12cd5851eee0677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Tue, 1 May 2012 11:17:43 +0200 Subject: Enable RPC logging. --- same/src/main/java/com/orbekk/same/SameController.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'same/src/main') diff --git a/same/src/main/java/com/orbekk/same/SameController.java b/same/src/main/java/com/orbekk/same/SameController.java index c7e18fa..e1513e8 100644 --- a/same/src/main/java/com/orbekk/same/SameController.java +++ b/same/src/main/java/com/orbekk/same/SameController.java @@ -53,7 +53,22 @@ public class SameController { } }; + public static void enableRpcLogging() { + java.util.logging.Level level = java.util.logging.Level.FINEST; + java.util.logging.Logger rpcLog = java.util.logging.Logger.getLogger( + com.orbekk.protobuf.RequestDispatcher.class.getName()); + rpcLog.setLevel(level); + java.util.logging.Logger channelLog = java.util.logging.Logger.getLogger( + com.orbekk.protobuf.RpcChannel.class.getName()); + channelLog.setLevel(level); + java.util.logging.Handler handler = new java.util.logging.ConsoleHandler(); + handler.setLevel(level); + rpcLog.addHandler(handler); + channelLog.addHandler(handler); + } + public static SameController create(Configuration configuration) { + enableRpcLogging(); int pport = configuration.getInt("pport"); String myLocation = configuration.get("localIp") + ":" + pport; -- cgit v1.2.3