tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allen Williams <anw-d...@infoisland.net>
Subject Re: Console Output Not Going Anywhere
Date Sun, 09 Aug 2009 15:57:57 GMT
It is the "standard" internal tomcat logging mechanism contained in the 
distribution of tomcat 6, based on java.util.logging.  I am not sure 
exactly what you're saying, but it does not seem to be consistent with 
the documentation here, which seems to indicate all this stuff is built-in:

http://tomcat.apache.org/tomcat-6.0-doc/logging.html

In the above documentation, I am using (or I should say, "attempting to 
use";-) the logging mechanism as explained under the heading 
"java.util.logging".

And I only just started trying tomcat's built-in logging.  I did have my 
on little logging subsystem using System.out and System.err (I know, I 
know, bad practice, but this app is originally several years old).  And, 
that still doesn't explain where my console goes.  If you can only log 
(or get console output) from servlets, how do you get debug information 
from the rest, i. e. not just the ContextListener, but also things like 
beans, etc?  I'm almost positive this was not the way tomcat5.5 worked, 
but I have an installation of 5.5 hosting the exact same webapp, so I'll 
check it and respond again in a few minutes.

Thanks a whole lot for taking a stab at this.

anw


Filip Hanik - Dev Lists wrote:
> That makes sense, Tomcat 6 doesn't use commons logging by default
>
> problem explained.
> if you want tomcat to use commons logging, you could build the extras 
> package
>
> Filip
>
> On 08/08/2009 07:34 PM, Martin Gainty wrote:
>> getLogger() is a method from
>> org.apache.commons.logging.impl.Log4JLoggerhttp://commons.apache.org/logging/commons-logging-1.0.3/docs/api/org/apache/commons/logging/impl/Log4JLogger.html

>>
>>
>> Martin Gainty
>> ______________________________________________
>> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>>
>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede 
>> unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. 
>> Diese Nachricht dient lediglich dem Austausch von Informationen und 
>> entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten 
>> Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den 
>> Inhalt uebernehmen.
>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes 
>> pas le destinataire prévu, nous te demandons avec bonté que pour 
>> satisfaire informez l'expéditeur. N'importe quelle diffusion non 
>> autorisée ou la copie de ceci est interdite. Ce message sert à 
>> l'information seulement et n'aura pas n'importe quel effet légalement 
>> obligatoire. Étant donné que les email peuvent facilement être sujets 
>> à la manipulation, nous ne pouvons accepter aucune responsabilité 
>> pour le contenu fourni.
>>
>>
>>
>>
>>   
>>> Date: Sat, 8 Aug 2009 18:19:48 -0600
>>> From: devlists@hanik.com
>>> To: users@tomcat.apache.org
>>> Subject: Re: Console Output Not Going Anywhere
>>>
>>> what class is Logger.getLogger(....), doesn't look like a tomcat class,
>>> so, no, it wont show up in the tomcat configured logs.
>>> Also, System.out/err only show up in the logs if you have swallowOutput
>>> set AND it happens during a request.
>>> ServletContextListener don't happen during servlet requests
>>>
>>> Filip
>>>
>>> On 08/08/2009 05:53 PM, Allen Williams wrote:
>>>     
>>>> Allen Williams wrote:
>>>>
>>>> I've fixed the exceptions that were being thrown and still have this,
>>>> 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.
>>>>
>>>>       
>>>>> Sorry, I should have mentioned that.  Yes, I've tried it both ways,
>>>>> multiple times.  BTW, is that something new in Tomcat6?  I've never
>>>>> seen it before now.
>>>>>
>>>>> Filip Hanik - Dev Lists wrote:
>>>>>         
>>>>>> did you set
>>>>>>
>>>>>> swallowOutput="true" in conf/context.xml?
>>>>>>
>>>>>> Filip
>>>>>>
>>>>>> On 08/07/2009 07:01 PM, Allen Williams wrote:
>>>>>>           
>>>>>>> I'm trying to get Tomcat 6 up and working; didn't have this problem
>>>>>>> on 5.
>>>>>>>
>>>>>>> The code:
>>>>>>>
>>>>>>> System.err.println
>>>>>>>
>>>>>>> does not print to the log files.  With this logging.properties:
>>>>>>>
>>>>>>> org.apache.catalina.core.ContainerBase.[Catalina].[info-dev].[/infoisland].level

>>>>>>>
>>>>>>> = ALL
>>>>>>> org.apache.catalina.core.ContainerBase.[Catalina].[info-dev].handlers

>>>>>>>
>>>>>>> = 3info-dev.org.apache.juli.FileHandler
>>>>>>>
>>>>>>> I get some exceptions, etc. in the info-dev.log file.  With this:
>>>>>>>
>>>>>>> org.apache.catalina.core.ContainerBase.[Catalina].[info-dev].[/infoisland].level

>>>>>>>
>>>>>>> = ALL
>>>>>>> org.apache.catalina.core.ContainerBase.[Catalina].[info-dev].[/infoisland].handlers

>>>>>>>
>>>>>>> = java.util.logging.ConsoleHandler
>>>>>>>
>>>>>>> I get zero bytes.  In neither of the above cases to I get the
>>>>>>> output from several System.err.println's or System.out.println's.
>>>>>>> Can someone tell me how to find out where my console is going,
or
>>>>>>> how to redirect it?
>>>>>>>
>>>>>>> TIA
>>>>>>> anw
>>>>>>>
>>>>>>> ---------------------------------------------------------------------

>>>>>>>
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>> ---------------------------------------------------------------------

>>>>>>
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>            
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>          
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>        
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>      
>>
>> _________________________________________________________________
>> Get back to school stuff for them and cashback for you.
>> http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1

>>
>>    
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message