You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Kennard <pe...@livingwork.com> on 2007/03/07 16:19:16 UTC

Console Logging

I have been looking about :)

I have a simple tomcat instance with one webapp in it.  I want to 
turn on "high level -vvvv type" logging to the console for internal 
debugging messages so I know what is happening.  I gather I have to 
put a log4j.properties file in common/classes  I put one I found in a 
howto and nothing happend (no file or change in console output)

I ideally I could turn it on/off (ie internal engine logging) in my 
application to braket things that are a problem.

    turnItOn();
    doSomethingThatBreaks();
    tornItOff();

Thanks in advance.


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


Re: Console Logging

Posted by Peter Kennard <pe...@livingwork.com>.
Thanks will check out after lunch.  I definately want to use the 
log4j for our apps.

I am assuming the Tomcat internals have very good debug log info like 
why sockets are closed or timed out etc (If I can get them activated 
:)  I dread finding out it might be a windows sockets bug :|

PK

At 13:18 3/7/2007, you wrote:


> > I did what it says here
> > http://minaret.biz/tips/log4j.html
> > but no results.
> >
> > I havn't found other decent "instructions" yet.
> > PK
> >
>
>try this one:
>http://www.vipan.com/htdocs/log4jhelp.html
>
>with http://minaret... you need to install another jar...
>
>Regards.
>FC
>
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >



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


Re: Console Logging

Posted by reno <re...@free.fr>.

> I did what it says here
> http://minaret.biz/tips/log4j.html
> but no results.
> 
> I havn't found other decent "instructions" yet.
> PK
> 

try this one:
http://www.vipan.com/htdocs/log4jhelp.html

with http://minaret... you need to install another jar...

Regards.
FC

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

RE: Console Logging

Posted by Peter Kennard <pe...@livingwork.com>.
That is interesting, Certainly for adminstration of many apps it 
would be great to have a good GUI for assigning log files to apps and 
log levels.

but I can't even get any debug output yet, much less tweak 
it.  Everyone warns about the volume of data when it's tured to "11", but:

Where I am:

With an "out of the box" Tomcat 5.5 install on my workstation (windows XP)
I set level=ALL  on every entry in conf/logging.properties

(no change to files or console print)

I tried setting them to DEBUG and it barfed saying DEBUG was in invalid value.

I set debug="10" on all the entities in the server.xml file

(likewise no change)
if I cd (catalina-home}/logs
grep DEBUG *
I get nothing.  And files arn't that big.  They are logging INFO 
however so they are being written to.

I put the newer version log4j1.3 jars in common/lib as described in a HOWTO.

This did change something, I got less console output and less info in 
the files.

I know it's looking there for catalina-base because if I change the 
server.xml file changes take effect when restarted.

I tried putting in both the log4j.properties and the log4j.xml files 
from the howto page, no change over putting in the jars.

I'm a bit mystified.  too many different sets of instructions and 
interactions I guess.

My problem is I am getting some apparently spontaneous socket 
closings reported by the client and want to find out detail.  All on 
local host, I'm simulating a slow "server push" application with:

    for(i = 0; i < 100; ++i)
    {
        Thread.sleep(200);
        res.getWriter().println("waiting " + i);
        res.flushBuffer();
    }
    res.getWriter().println("done!");
    res.flushBuffer();

Using flushBuffer() makes "Transfer-Encoding: chunked" chunks in the reply.

My client reports the socket is closed way before the "done" is 
recived in about 80% of cases.  Otherwise tomcat is sending HTTP 
chunks exactly as expected and to HTTP1.1 spec when it works.  I 
figure on the clinet I should get all the chunks up to the terminal 
chunk \r\n0\r\n before the socket is closed.

I need to figure this out, it's kind of a fundamental basic thing, 
I'm a bit stuck.

PK

At 12:37 3/7/2007, you wrote:
>I wrote an application which allows you to modify the running log4j
>configuration on the fly.  It's a Struts app, and relies on the fact that
>tomcat and all the apps are running out of common/lib/log4j*.jar and
>common/classes/log4j.properties.  However, you could add the servlet, jars,
>and mappings to a single app if you wish.  I have found it useful for
>turning up or down logging levels on a running production system.  It will
>revert to your log4j.properties configuration as well, so you can easily go
>back to the configured settings when you're done.
>
>I can send you (or anyone else who is interested) the sources and/or war.
>PM me off-list.
>
>Tim
>
> > -----Original Message-----
> > From: Peter Kennard [mailto:peterk@livingwork.com]
> > Sent: Wednesday, March 07, 2007 10:59 AM
> > To: Tomcat Users List
> > Subject: Re: Console Logging
> >
> > I did what it says here
> > http://minaret.biz/tips/log4j.html
> > but no results.
> >
> > I havn't found other decent "instructions" yet.
> > PK



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


RE: Console Logging

Posted by Tim Lucia <ti...@yahoo.com>.
I wrote an application which allows you to modify the running log4j
configuration on the fly.  It's a Struts app, and relies on the fact that
tomcat and all the apps are running out of common/lib/log4j*.jar and
common/classes/log4j.properties.  However, you could add the servlet, jars,
and mappings to a single app if you wish.  I have found it useful for
turning up or down logging levels on a running production system.  It will
revert to your log4j.properties configuration as well, so you can easily go
back to the configured settings when you're done.

I can send you (or anyone else who is interested) the sources and/or war.
PM me off-list.

Tim

> -----Original Message-----
> From: Peter Kennard [mailto:peterk@livingwork.com]
> Sent: Wednesday, March 07, 2007 10:59 AM
> To: Tomcat Users List
> Subject: Re: Console Logging
> 
> I did what it says here
> http://minaret.biz/tips/log4j.html
> but no results.
> 
> I havn't found other decent "instructions" yet.
> PK
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org




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


Re: Console Logging

Posted by Peter Kennard <pe...@livingwork.com>.
I did what it says here
http://minaret.biz/tips/log4j.html
but no results.

I havn't found other decent "instructions" yet.
PK


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