Missing logs – Tomcat 5.5 + Ubuntu 8.04 – Server Fault

Summary

Freshly-installed (via apt-get) Tomcat on a freshly-installed Ubuntu 8.04 LTS 64-bit works, but doesn’t (seem to) log anything. See also “What I’ve Tried” and “Closing In On It” below.

More Detail

Because the package maintainers have done a HUGE amount of the work, getting basic things working has been a fairly straightfoward matter of running apt-get and pointing Tomcat at the right JDK. And it works. But it doesn’t appear to log anything.

As far as I can tell, the logging infrastructure is controlled via logging.properties files (since this is Tomcat 5.5, not Tomcat 5.0), including a central one (which you can override per web app) at /etc/tomcat55/logging.properties (/etc/tomcat55 is symlinked as /var/lib/tomcat55/conf). I’m not overriding it, and I can’t see why I’m not seeing something. Here’s the file:

 1 1 # Licensed to the Apache Software Foundation (ASF) under one or more   2  2 # contributor license agreements.  See the NOTICE file distributed with   3  3 # this work for additional information regarding copyright ownership.   4  4 # The ASF licenses this file to You under the Apache License, Version 2.0   5  5 # (the "License"); you may not use this file except in compliance with   6  6 # the License.  You may obtain a copy of the License at   7  7 #   8  8 #     http://www.apache.org/licenses/LICENSE-2.0   9  9 #  10 10 # Unless required by applicable law or agreed to in writing, software  11 11 # distributed under the License is distributed on an "AS IS" BASIS,  12 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  13 13 # See the License for the specific language governing permissions and  14 14 # limitations under the License.  15 15   16 16 handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4admin.org.apache.juli.FileHandler, 5host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler  17 17   18 18 .handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler  19 19   20 20 ############################################################  21 21 # Handler specific properties.  22 22 # Describes specific configuration info for Handlers.  23 23 ############################################################  24 24   25 25 1catalina.org.apache.juli.FileHandler.level = FINE  26 26 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs  27 27 1catalina.org.apache.juli.FileHandler.prefix = catalina.  28 28   29 29 2localhost.org.apache.juli.FileHandler.level = FINE  30 30 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs  31 31 2localhost.org.apache.juli.FileHandler.prefix = localhost.  32 32   33 33 3manager.org.apache.juli.FileHandler.level = FINE  34 34 3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs  35 35 3manager.org.apache.juli.FileHandler.prefix = manager.  36 36   37 37 4admin.org.apache.juli.FileHandler.level = FINE  38 38 4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs  39 39 4admin.org.apache.juli.FileHandler.prefix = admin.  40 40   41 41 5host-manager.org.apache.juli.FileHandler.level = FINE  42 42 5host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs  43 43 5host-manager.org.apache.juli.FileHandler.prefix = host-manager.  44 44   45 45 java.util.logging.ConsoleHandler.level = FINE  46 46 java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter  47 47   48 48   49 49 ############################################################  50 50 # Facility specific properties.  51 51 # Provides extra control for each logger.  52 52 ############################################################  53 53   54 54 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = DEBUG  55 55 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler  56 56   57 57 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO  58 58 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler  59 59   60 60 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].level = INFO  61 61 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].handlers = 4admin.org.apache.juli.FileHandler  62 62   63 63 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO  64 64 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 5host-manager.org.apache.juli.FileHandler  65 65   66 66 # For example, set the com.xyz.foo logger to only log SEVERE  67 67 # messages:  68 68 #org.apache.catalina.startup.ContextConfig.level = DEBUG  69 69 #org.apache.catalina.startup.HostConfig.level = DEBUG  70 70 #org.apache.catalina.session.ManagerBase.level = DEBUG 

The only change I’ve made is:

1 1 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = DEBUG 

…which was set to INFO like all the others, but I wanted to get it to log something, so I upped it to DEBUG. Naturally I’ve restarted Tomcat.

I can compile and view a JSP, so again Tomcat is working, but /var/lib/tomcat5.5/logs is stubbornly empty. Even if I force an error by having an invalid JSP or some such, I’m getting nothing.

What I’ve Tried

  • I’ve been through the steps listed in the Tomcat FAQ for ensuring that the distro hasn’t messed things up (they hadn’t).
  • I’ve gone looking for a logs directory elsewhere in case it’s not /var/lib/tomcat5.5/logs (although that was created by the install).
  • Naturally I’ve restarted Tomcat after making any changes.

One thing I haven’t done is to chown everything to be owned by the tomcat55 user that the install created. logs is owned by tomcat55, but a number of the other directories and files are owned by root, though they’re world-readable. I haven’t done this because (hangs head) I can’t quite figure out how to fully back-up the existing tree so I can readily undo the change. The blasted tree has absolute symlinks interweaving /etc/tomcat55, /var/lib/tomcat55, and /usr/share/tomcat55 that I know of. I could tar up each of those, but I don’t know for certain I’m not missing something.

EDIT:

Closing In On It

Okay, so I’ve found that it’s writing console-style stuff to /var/log/daemon.log. Whew! At least that gives me a place to start. And it’s issuing complaints like:

1 1 jsvc.exec[18819]: Can't load log handler "2localhost.org.apache.juli.FileHandler"  2 2 jsvc.exec[18819]: java.lang.ClassNotFoundException: 2localhost.org.apache.juli.FileHandler 

And I’m not surprised, 2localhost.org.apache.juli.FileHandler isn’t a valid class name (packages can’t start with digits!). So I’m suspecting that the default logging.properties file is…not good. Will report back.

Geez…. It’s a good thing I found this excellent information on Tomcat 5.5, because I couldn’t find out why there were no logs!

Advertisement

2 Responses to “Missing logs – Tomcat 5.5 + Ubuntu 8.04 – Server Fault”

  1. malaysianshrew Says:

    I was googling for how to setup the manager’s app logging when I found your site. Those prefixes are valid but “Debug” is not a valid setting:

    From the documentation:

    “A prefix may be added to handler names, so that multiple handlers of a single class may be instantiated. A prefix is a String which starts with a digit, and ends with ‘.’. For example, 22foobar. is a valid prefix.”

    Also:

    “A handler’s log level threshold can be set using SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST or ALL. The logging.properties shipped with JDK is set to INFO.”

    So those are your possible settings.

  2. ibacsoft Says:

    Geez, maybe it uses a default setting instead of DEBUG?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.