anw
08-08-2009, 07:47 PM
Tomcat 6.0, despite having this in my code:
public class AppInitializer implements ServletContextListener
{
public void contextInitialized(ServletContextEvent e)
{
log2.log(Level.FINEST, "\n************ In contextInitialized **************\n");
System.out.println("\n************ In contextInitialized **************\n");
System.out.flush();
System.err.println("\n************ In contextInitialized **************\n");
System.err.flush();
<snip>
private static Logger log2= Logger.getLogger("3info-dev.org.apache");
I can't get anything to display in any of the log files. Here is my 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.
# Logging levels: SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST or ALL
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3info-dev.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.level=WARNING
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
1catalina.org.apache.juli.FileHandler.level = WARNING
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
2localhost.org.apache.juli.FileHandler.level = WARNING
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
3info-dev.org.apache.juli.FileHandler.level = ALL
3info-dev.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3info-dev.org.apache.juli.FileHandler.prefix = info-dev.
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
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].[info-dev].[/infoisland].level = ALL
org.apache.catalina.core.ContainerBase.[Catalina].[info-dev].[/infoisland].handlers = 3info-dev.org.apache.juli.FileHandler
# org.apache.catalina.core.ContainerBase.[Catalina].[info-dev].[/infoisland].handlers = java.util.logging.ConsoleHandler
utils.AppInitializer.level = ALL
# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#org.apache.catalina.startup.ContextConfig.level = FINE
#org.apache.catalina.startup.HostConfig.level = FINE
#org.apache.catalina.session.ManagerBase.level = FINE
#org.apache.catalina.core.AprLifecycleListener.level=FINE
and here are the log files that are produced-
catalina.xxx.log:
Aug 8, 2009 7:06:40 PM org.apache.catalina.users.MemoryUserDatabase save
WARNING: User database is not persistable - no write permissions on directory
info-dev.log:
Aug 8, 2009 7:06:41 PM org.apache.catalina.core.StandardContext listenerStart
FINE: Sending application start events
Aug 8, 2009 7:06:41 PM org.apache.catalina.core.StandardContext filterStart
FINE: Starting filters
localhost.log:
<null>, i. e., nothing in log
ANY ideas why my console AND my log file are being sent to a black hole? BTW, I have also set and unset swallowOutput="true" multiple times in my <Context> tag.
public class AppInitializer implements ServletContextListener
{
public void contextInitialized(ServletContextEvent e)
{
log2.log(Level.FINEST, "\n************ In contextInitialized **************\n");
System.out.println("\n************ In contextInitialized **************\n");
System.out.flush();
System.err.println("\n************ In contextInitialized **************\n");
System.err.flush();
<snip>
private static Logger log2= Logger.getLogger("3info-dev.org.apache");
I can't get anything to display in any of the log files. Here is my 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.
# Logging levels: SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST or ALL
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3info-dev.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.level=WARNING
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
1catalina.org.apache.juli.FileHandler.level = WARNING
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
2localhost.org.apache.juli.FileHandler.level = WARNING
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
3info-dev.org.apache.juli.FileHandler.level = ALL
3info-dev.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3info-dev.org.apache.juli.FileHandler.prefix = info-dev.
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
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].[info-dev].[/infoisland].level = ALL
org.apache.catalina.core.ContainerBase.[Catalina].[info-dev].[/infoisland].handlers = 3info-dev.org.apache.juli.FileHandler
# org.apache.catalina.core.ContainerBase.[Catalina].[info-dev].[/infoisland].handlers = java.util.logging.ConsoleHandler
utils.AppInitializer.level = ALL
# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#org.apache.catalina.startup.ContextConfig.level = FINE
#org.apache.catalina.startup.HostConfig.level = FINE
#org.apache.catalina.session.ManagerBase.level = FINE
#org.apache.catalina.core.AprLifecycleListener.level=FINE
and here are the log files that are produced-
catalina.xxx.log:
Aug 8, 2009 7:06:40 PM org.apache.catalina.users.MemoryUserDatabase save
WARNING: User database is not persistable - no write permissions on directory
info-dev.log:
Aug 8, 2009 7:06:41 PM org.apache.catalina.core.StandardContext listenerStart
FINE: Sending application start events
Aug 8, 2009 7:06:41 PM org.apache.catalina.core.StandardContext filterStart
FINE: Starting filters
localhost.log:
<null>, i. e., nothing in log
ANY ideas why my console AND my log file are being sent to a black hole? BTW, I have also set and unset swallowOutput="true" multiple times in my <Context> tag.