Tweaked the log4j configuration a little and added a verbose logging example.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 11 Feb 2003 21:24:20 +0000 (21:24 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 11 Feb 2003 21:24:20 +0000 (21:24 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@458 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/AAServlet.java
src/edu/internet2/middleware/shibboleth/hs/HandleServlet.java
src/edu/internet2/middleware/shibboleth/log/LogServ.java
webApplication/WEB-INF/conf/log4j.properties

index 9270491..36a9b6f 100755 (executable)
@@ -100,7 +100,7 @@ public class AAServlet extends HttpServlet {
        public void init() throws ServletException {
                super.init();
 
-               MDC.put("serviceId", "[AA Core]");
+               MDC.put("serviceId", "[AA] Core");
                log.info("Initializing Attribute Authority.");
 
                try {
@@ -197,7 +197,7 @@ public class AAServlet extends HttpServlet {
        public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
 
                log.debug("Recieved a request.");
-               MDC.put("serviceId", new SAMLIdentifier().toString());
+               MDC.put("serviceId", "[AA] " + new SAMLIdentifier().toString());
                MDC.put("remoteAddr", req.getRemoteAddr());
                log.info("Handling request.");
 
index b42c405..59eda1b 100644 (file)
@@ -140,7 +140,7 @@ public class HandleServlet extends HttpServlet {
 
        public void init() throws ServletException {
                super.init();
-               MDC.put("serviceId", "[HS Core]");
+               MDC.put("serviceId", "[HS] Core");
                try {
                        log.info("Initializing Handle Service.");
                        configuration = loadConfiguration();
@@ -223,7 +223,7 @@ public class HandleServlet extends HttpServlet {
        public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
 
                log.debug("Recieved a request.");
-               MDC.put("serviceId", UUIDGenerator.getInstance().generateRandomBasedUUID());
+               MDC.put("serviceId", "[HS] " + UUIDGenerator.getInstance().generateRandomBasedUUID());
                MDC.put("remoteAddr", req.getRemoteAddr());
                log.info("Handling request.");
 
index ad9cc2b..c98ae06 100755 (executable)
@@ -82,7 +82,7 @@ public class LogServ extends HttpServlet {
                        log4jConfigFileLocation = "/WEB-INF/conf/log4j.properties";
                }
                PropertyConfigurator.configure(getServletContext().getRealPath("/") + log4jConfigFileLocation);
-                       MDC.put("serviceId", "[Logging Core]");
+                       MDC.put("serviceId", "[Logger] Core");
                log.info("Logger initialized.");
        }
 
index 4d39e82..11d90a2 100755 (executable)
@@ -1,22 +1,42 @@
-# Default Log4J configuration.  Sends logging output to STDOUT.
+##
+#
+# Shibboleth Log4J configuration
+#
+##
+
+
+# Default configuration.  Sends logging output to STDOUT.
 
 log4j.rootCategory=WARN, stdout
 log4j.logger.org.apache.xml.security=OFF
+log4j.logger.org.opensaml=OFF
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%-5p %-36X{serviceId} %d{ISO8601} (%c:%L) - %m%n
+log4j.appender.stdout.layout.ConversionPattern=%-5p %-41X{serviceId} %d{ISO8601} - %m%n
 
 
-# Uncomment the following line to enable verbose debugging output concerning log4j initialization.
-#log4j.debug=TRUE
+# The following block represents an example of how to enable very verbose logging.
+
+#log4j.rootCategory=DEBUG, stdout
+#log4j.logger.org.apache.xml.security=OFF
+#log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+#log4j.appender.stdout.layout.ConversionPattern=%-5p %-41X{serviceId} %d{ISO8601} (%c:%L) - %m%n
 
 
 # The following block represents an example of how to direct logging output to a file.
-#log4j.rootCategory=DEBUG, file
+
+#log4j.rootCategory=INFO, file
 #log4j.logger.org.apache.xml.security=OFF
+#log4j.logger.org.opensaml=OFF
 #log4j.appender.file=org.apache.log4j.RollingFileAppender
 #log4j.appender.file.File=/var/log/shib.log
 #log4j.appender.file.MaxFileSize=100KB
 #log4j.appender.file.MaxBackupIndex=1
 #log4j.appender.file.layout=org.apache.log4j.PatternLayout
-#log4j.appender.file.layout.ConversionPattern=%5p [%t] (%c:%L) - %m%n
\ No newline at end of file
+#log4j.appender.file.layout.ConversionPattern=%-5p %-41X{serviceId} %d{ISO8601} - %m%n
+
+
+# Uncomment the following line to enable verbose debugging output concerning log4j initialization.
+
+#log4j.debug=TRUE
\ No newline at end of file