---- oh...@cox.net wrote: > > ---- Konstantin Kolinko <knst.koli...@gmail.com> wrote: > > 2012/5/17 <oh...@cox.net>: > > > Hi, > > > > > > I'm trying to debug some problems while enabling JNDIRealm in Tomcat > > > 6.0.33. > > > > > > I've gotten Tomcat itself to output debug logging, but looking at the > > > JNDIRealm.java code, e.g.: > > > > > > http://www.docjar.com/html/api/org/apache/catalina/realm/JNDIRealm.java.html > > > > > > It looks like there's a bunch of debug output that the Java code *can* > > > output. > > > > > > The problem is that I don't know how to enable that debug output/logging? > > > > > > I'm assuming that something needs to be added to the Tomcat > > > logging.properties, but can anyone tell me what that should be to get the > > > messages such as would be output by the following code in JNDIRealm.java: > > > > > > 1044 if (username == null || username.equals("") > > > 1045 || credentials == null || credentials.equals("")) { > > > 1046 if (containerLog.isDebugEnabled()) > > > 1047 containerLog.debug("username null or empty: > > > returning null principal."); > > > 1048 return (null); > > > > > > > > > See > > http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Servlets_logging_API > > > > The "containerLog" writes to a category that has name similar to the > > following: > > org.apache.catalina.core.ContainerBase.[${engine}].[${host}].[${context}] > > > > If your realm in in Context, then you will get the full name. > > If it is in Host, you will get [engine][host] only, > > and so on. > > > > > > You may also want to run under debugger, > > http://wiki.apache.org/tomcat/FAQ/Developing#Debugging > > > > Best regards, > > Konstantin Kolinko > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > Konstantin, > > Here's a partial stripped down version of my server.xml, to show the > JNDIRealm part in context. I guess that it's in the <Engine>? > > So, how do I enable the output from the JNDIRealm? > > I checked the link you included, but it reflected what you said, but I'm > unclear about exactly what I need to do (e.g., add to logging.properties) to > get the debug output? > > Thanks, > Jim > > P.S. Per other responses, if you could help explain, it might clarify things > for others on the mailing list, who also appear to not know how to do this? > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org >
P.P.S. In case it helps, here is my current logging.properties: # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler .handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler ############################################################ # Handler specific properties. # Describes specific configuration info for Handlers. ############################################################ 1catalina.org.apache.juli.FileHandler.level = FINE 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 1catalina.org.apache.juli.FileHandler.prefix = catalina. # JL - FOLLOWING ADDED FOR DEBUG PER: http://dev-answers.blogspot.com/2010/03/enable-debugtrace-level-logging-for.html 1catalina.org.apache.juli.FileHandler.bufferSize = -1 2localhost.org.apache.juli.FileHandler.level = FINE 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 2localhost.org.apache.juli.FileHandler.prefix = localhost. 3manager.org.apache.juli.FileHandler.level = FINE 3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 3manager.org.apache.juli.FileHandler.prefix = manager. 4host-manager.org.apache.juli.FileHandler.level = FINE 4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 4host-manager.org.apache.juli.FileHandler.prefix = host-manager. java.util.logging.ConsoleHandler.level = FINE java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter ############################################################ # Facility specific properties. # Provides extra control for each logger. ############################################################ # JL - FOLLOWING ADDED FOR DEBUG PER: http://dev-answers.blogspot.com/2010/03/enable-debugtrace-level-logging-for.html # This would turn on trace-level for everything # the possible levels are: SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST or ALL #org.apache.catalina.level = ALL #org.apache.catalina.handlers = 2localhost.org.apache.juli.FileHandler org.apache.catalina.realm.level = ALL org.apache.catalina.realm.useParentHandlers = true org.apache.catalina.authenticator.level = ALL org.apache.catalina.authenticator.useParentHandlers = true org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler # For example, to log debug messages in ContextConfig and HostConfig # classes and to log only warnings and errors in other # org.apache.catalina.** classes, uncomment these lines: #org.apache.catalina.startup.ContextConfig.level = FINE #org.apache.catalina.startup.HostConfig.level = FINE #org.apache.catalina.level = WARNING --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org