Adding logging configuration for tomcat (JULI) 16/2116/2
authormrajvaid <mrajvaid@cisco.com>
Wed, 23 Oct 2013 18:25:49 +0000 (11:25 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 24 Oct 2013 17:11:03 +0000 (17:11 +0000)
Change-Id: I54c6740e71e59ec566b7809e9fe90d7a26ec1abc
Signed-off-by: mrajvaid <mrajvaid@cisco.com>
opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-logging.properties [new file with mode: 0644]
third-party/org.apache.catalina.filters.CorsFilter/pom.xml

index b0ad555..caf9d09 100644 (file)
@@ -111,3 +111,6 @@ enableStrongPasswordCheck = false
 
 #Jolokia configurations
 org.jolokia.listenForHttpService=false
+
+# Logging configuration for Tomcat-JUL logging
+java.util.logging.config.file=configuration/tomcat-logging.properties
diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-logging.properties b/opendaylight/distribution/opendaylight/src/main/resources/configuration/tomcat-logging.properties
new file mode 100644 (file)
index 0000000..3dbd992
--- /dev/null
@@ -0,0 +1,42 @@
+############################################################
+# Configuration file for tomcat logging
+############################################################
+# Handlers:
+# "handlers" specifies a comma separated list of log Handler
+# classes.  These handlers will be installed during VM startup.
+# Note that these classes must be on the system classpath.
+# Following line configures a ConsoleHandler and a FileHandler
+
+handlers= java.util.logging.FileHandler,java.util.logging.ConsoleHandler
+
+############################################################
+# Handler specific properties
+# Describes specific configuration info for Handlers
+# JUL does not support rolling file handler based on date
+# For now we will keep count of files to 5 with rolling size of 10MB
+############################################################
+
+java.util.logging.FileHandler.pattern = logs/tomcat%g.log
+java.util.logging.FileHandler.limit = 104857600
+java.util.logging.FileHandler.count = 5
+java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
+java.util.logging.FileHandler.append = true
+java.util.logging.FileHandler.level = INFO
+
+# Limit the message that are printed on the console to SEVERE and above.
+java.util.logging.ConsoleHandler.level = WARNING
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+# SimpleFormatter output format to print one-line log message like this:
+# <YYYY>-<MM>-<DD> <HH>:<MM>:<SS> <TimeZone> [<SOURCE>] ><LOG_LEVEL> <LOGGER> <MESSAGE> <THROWABLE>
+#
+java.util.logging.SimpleFormatter.format=%1$tF %1$tT %1$tZ [%3$s] %4$s %2$s %5$s%6$s%n
+
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+
+# For example, set the com.xyz.foo logger to only log SEVERE
+# messages
+#org.apache.catalina = SEVERE
index e3d490f..85e6316 100644 (file)
               javax.servlet,
               javax.servlet.http,
               org.apache.catalina.filters,
-              org.apache.juli.logging,
               org.apache.tomcat.util.res,
               org.apache.catalina.comet,
               org.apache.tomcat.util
             </Import-Package>
+            <Export-Package>
+              org.apache.juli.*
+            </Export-Package>
           </instructions>
           <manifestLocation>${project.basedir}/META-INF</manifestLocation>
         </configuration>