You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael <mi...@idtect.com> on 2002/08/27 10:16:14 UTC

How can I see log4j output on the console?

My log4j log messages go to a logfile but I'd really like to see them in
the console output.  Is it possible to do this??

Michael


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Logging to console not working with Tomcat 4.1.9

Posted by Tony LaPaso <tl...@attbi.com>.
Well, honestly, I don't know about log4j. I know that prior to
v4.1.9 I would use System.out/err to do light logging to the
console and as of v4.1.9 it quit working. I'm not sure if
System.out/err are routed to log4j.

sorry...


----- Original Message -----
From: "Michael" <mi...@idtect.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Wednesday, August 28, 2002 9:47 AM
Subject: RE : Logging to console not working with Tomcat 4.1.9


> No I mean log4j's ConsoleAppender.  So are you saying that
Tomcat now
> routes the log4j ConsoleAppender to a logfile as well?  If so I
think
> that's a big problem for debugging.  While running my app in
the IDE I
> want to see all the console output without having to switch to
a text
> editor and reload the log file.  Can I configure Tomcat 4.1.9
to do
> this??
>
> Michael
>
> > -----Original Message-----
> > From: Tony LaPaso [mailto:tlapaso@attbi.com]
> > Sent: Wednesday, August 28, 2002 4:38 PM
> > To: Tomcat Users List
> > Subject: Re: Logging to console not working with Tomcat 4.1.9
> >
> >
> > So you mean output to System.out & System.err? As of 4.1.9
> > that's been changed to go to a log file.
> >
> >
> >
> > ----- Original Message -----
> > From: "Michael" <mi...@idtect.com>
> > To: "'Tomcat Users List'" <to...@jakarta.apache.org>
> > Sent: Wednesday, August 28, 2002 9:20 AM
> > Subject: BUG: Logging to console not working with Tomcat
4.1.9
> >
> >
> > > I uninstalled 4.1.9 and installed 4.0.4. When I start
tomcat I
> > get pages
> > > and pages of debug log messages on the console from the
apache
> > tools I'm
> > > using (Struts, messenger, etc.) and my own classes.  I
> > uninstalled 4.0.4
> > > and installed 4.1.9 and when I run it I only get 4 lines.
I
> > haven't
> > > changed anything in my code or the tomcat directory.  So
I'm
> > 100%
> > > positive something is broken in 4.1.9 regarding outputing
> > messages to
> > > the console.  For now I've switched back to 4.0.4 and
logging
> > to the
> > > console is working just fine.
> > >
> > > I filed a bug on Bugzilla, I'll post any responses I get to
the
> > mailing
> > > list.
> > >
> > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12113
> > >
> > >
> > > Michael
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> > For
> > additional commands,
> > e-mail: <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE : RE : Logging to console not working with Tomcat 4.1.9

Posted by Michael <mi...@idtect.com>.
> -- but of course it's still really easy to use
> 
>   tail -f $CATALINA_HOME/logs/catalina.out"
> 
> to monitor the output.  On recent Windows OSs (but not 98) 
> you can accomplish the same thing by installing CYGWIN and 
> using it's "tail" command.

The problem is when using an IDE like Eclipse.  I don't have room on the
screen for another log window.

The good news is I just read on the bug report that a new feature has
been added to the nightly build which will allow this behavior to be
turned on or off, thereby allowing output to the console!  I find this
extremely useful for debugging with Eclipse.

Michael


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: RE : Logging to console not working with Tomcat 4.1.9

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 28 Aug 2002, Michael wrote:

> Date: Wed, 28 Aug 2002 16:47:39 +0200
> From: Michael <mi...@idtect.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: 'Tomcat Users List' <to...@jakarta.apache.org>
> Subject: RE : Logging to console not working with Tomcat 4.1.9
>
> No I mean log4j's ConsoleAppender.  So are you saying that Tomcat now
> routes the log4j ConsoleAppender to a logfile as well?  If so I think
> that's a big problem for debugging.  While running my app in the IDE I
> want to see all the console output without having to switch to a text
> editor and reload the log file.  Can I configure Tomcat 4.1.9 to do
> this??
>

IIRC, the ConsoleAppender in Log4J just writes to System.out or
System.err, so Tomcat redirecting those streams will affect Log4J as well.

On Unix systems, Tomcat has *always* redirected console output to a file
-- but of course it's still really easy to use

  tail -f $CATALINA_HOME/logs/catalina.out"

to monitor the output.  On recent Windows OSs (but not 98) you can
accomplish the same thing by installing CYGWIN and using it's "tail"
command.

> Michael

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE : Logging to console not working with Tomcat 4.1.9

Posted by Michael <mi...@idtect.com>.
No I mean log4j's ConsoleAppender.  So are you saying that Tomcat now
routes the log4j ConsoleAppender to a logfile as well?  If so I think
that's a big problem for debugging.  While running my app in the IDE I
want to see all the console output without having to switch to a text
editor and reload the log file.  Can I configure Tomcat 4.1.9 to do
this??

Michael

> -----Original Message-----
> From: Tony LaPaso [mailto:tlapaso@attbi.com] 
> Sent: Wednesday, August 28, 2002 4:38 PM
> To: Tomcat Users List
> Subject: Re: Logging to console not working with Tomcat 4.1.9
> 
> 
> So you mean output to System.out & System.err? As of 4.1.9 
> that's been changed to go to a log file.
> 
> 
> 
> ----- Original Message -----
> From: "Michael" <mi...@idtect.com>
> To: "'Tomcat Users List'" <to...@jakarta.apache.org>
> Sent: Wednesday, August 28, 2002 9:20 AM
> Subject: BUG: Logging to console not working with Tomcat 4.1.9
> 
> 
> > I uninstalled 4.1.9 and installed 4.0.4. When I start tomcat I
> get pages
> > and pages of debug log messages on the console from the apache
> tools I'm
> > using (Struts, messenger, etc.) and my own classes.  I
> uninstalled 4.0.4
> > and installed 4.1.9 and when I run it I only get 4 lines.  I
> haven't
> > changed anything in my code or the tomcat directory.  So I'm
> 100%
> > positive something is broken in 4.1.9 regarding outputing
> messages to
> > the console.  For now I've switched back to 4.0.4 and logging
> to the
> > console is working just fine.
> >
> > I filed a bug on Bugzilla, I'll post any responses I get to the
> mailing
> > list.
> >
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12113
> >
> >
> > Michael
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Logging to console not working with Tomcat 4.1.9

Posted by Tony LaPaso <tl...@attbi.com>.
So you mean output to System.out & System.err? As of 4.1.9 that's
been changed to go to a log file.



----- Original Message -----
From: "Michael" <mi...@idtect.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Wednesday, August 28, 2002 9:20 AM
Subject: BUG: Logging to console not working with Tomcat 4.1.9


> I uninstalled 4.1.9 and installed 4.0.4. When I start tomcat I
get pages
> and pages of debug log messages on the console from the apache
tools I'm
> using (Struts, messenger, etc.) and my own classes.  I
uninstalled 4.0.4
> and installed 4.1.9 and when I run it I only get 4 lines.  I
haven't
> changed anything in my code or the tomcat directory.  So I'm
100%
> positive something is broken in 4.1.9 regarding outputing
messages to
> the console.  For now I've switched back to 4.0.4 and logging
to the
> console is working just fine.
>
> I filed a bug on Bugzilla, I'll post any responses I get to the
mailing
> list.
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12113
>
>
> Michael
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


BUG: Logging to console not working with Tomcat 4.1.9

Posted by Michael <mi...@idtect.com>.
I uninstalled 4.1.9 and installed 4.0.4. When I start tomcat I get pages
and pages of debug log messages on the console from the apache tools I'm
using (Struts, messenger, etc.) and my own classes.  I uninstalled 4.0.4
and installed 4.1.9 and when I run it I only get 4 lines.  I haven't
changed anything in my code or the tomcat directory.  So I'm 100%
positive something is broken in 4.1.9 regarding outputing messages to
the console.  For now I've switched back to 4.0.4 and logging to the
console is working just fine.

I filed a bug on Bugzilla, I'll post any responses I get to the mailing
list.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12113


Michael


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE : How can I see log4j output on the console?

Posted by Michael <mi...@idtect.com>.
Here is the log4j.properties file I'm using.  I think this is more of an
issue with Tomcat.  I have a servlet that kicks off a TimerTask, and my
log4j output inside this task does show up on the console.  But my log4j
output from regular java classes (called via a servlet) does not.

log4j.rootLogger=debug, screen, file
log4j.category.com.idtect=

log4j.appender.screen=org.apache.log4j.ConsoleAppender
log4j.appender.screen.layout=org.apache.log4j.PatternLayout
log4j.appender.screen.layout.ConversionPattern=%d{ABSOLUTE} %-5p %c{1} -
%m%n

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=c:\oemserver.log
log4j.appender.file.Append=false
log4j.appender.file.MaxFileSize=200KB
log4j.appender.file.MaxBackupIndex=0
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %-5p %c{1} -
%m%n

> -----Original Message-----
> From: Andy Eastham [mailto:andy.eastham@gliant.com] 
> Sent: Tuesday, August 27, 2002 10:29 AM
> To: Tomcat Users List
> Subject: RE: How can I see log4j output on the console?
> 
> 
> Michael,
> 
> Here's an example config file that logs to a file and the console.
> 
> Andy
> 
> > -----Original Message-----
> > From: Michael [mailto:michael@idtect.com]
> > Sent: 27 August 2002 09:16
> > To: Tomcat Users List
> > Subject: How can I see log4j output on the console?
> > 
> > 
> > My log4j log messages go to a logfile but I'd really like 
> to see them 
> > in the console output.  Is it possible to do this??
> > 
> > Michael
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > 
> > 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How can I see log4j output on the console?

Posted by Andy Eastham <an...@gliant.com>.
Michael,

Here's an example config file that logs to a file and the console.

Andy

> -----Original Message-----
> From: Michael [mailto:michael@idtect.com]
> Sent: 27 August 2002 09:16
> To: Tomcat Users List
> Subject: How can I see log4j output on the console?
> 
> 
> My log4j log messages go to a logfile but I'd really like to see them in
> the console output.  Is it possible to do this??
> 
> Michael
> 
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 
> 

How to import a bean in a JSP under Tomcat 4.1.9

Posted by Nicolas S i l b e r z a h n <Ni...@DigitalAirways.com>.

Bonjour,

This has worked with Tomcat 4.0.4 to use a bean:

<%@ page import="DevOffer"%><%
DevOffer handler = (DevOffer)session.getAttribute("DevOffer");
if(handler==null) {
	handler = new DevOffer();

	}

%>

With tomcat 4.1.9, it générates an error:

2002-08-27 19:38:07 Error compiling file: F:\Tomcat
4.1.9\work\Standalone\localhost\ecomm\/DevOffer_jsp.java     [javac]
Compiling 1 source file
F:\Tomcat 4.1.9\work\Standalone\localhost\ecomm\DevOffer_jsp.java:11: '.'
expected


Help!


N i c o l a s   S i l b e r z a h n

<100% Java, Mobile, Offline aware>Wapaka Browser for mobile development
(XHTML, WML)</100% Java, Mobile, Offline aware> www.Wapaka.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>