tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leon Rosenberg <rosenberg.l...@gmail.com>
Subject Re: Understanding RequestDispatcher
Date Wed, 07 Nov 2012 09:45:31 GMT
Hello Konstantin,


On Wed, Nov 7, 2012 at 10:22 AM, Konstantin Kolinko
<knst.kolinko@gmail.com>wrote:

> 2012/11/7 Leon Rosenberg <rosenberg.leon@gmail.com>:
> > Hello,
> >
> > I have a pretty weird behavior I don't understand in a customers
> > application. We have a drop-in monitoring webapp (moskito.anotheria.net)
> > which is installed by placing a jar into the target webapp and adding a
> > filter. This filter works pretty similar to struts 1.x, grab the url,
> > execute  some code, make a forward to a jsp. It works in many
> applications.
> >
> > However we encounter recently a problem with a clients installation, that
> > req.getForward goes back to the apache httpd in front of tomcat and in
> some
> > cases to the browser.
> >
> > Here what usually happens:
> >
> > Browser calls http://server/blub
> > in localhost_access logs I see the call to blub
> > 0:0:0:0:0:0:0:1 - - [07/Nov/2012:09:45:32 +0100] "GET
> > /moskitodemo/mui/mskThresholds HTTP/1.1" 200 21398
> >
> > The servlet makes an internal forward
> > (req.getRequestDispatcher(path_to_jsp).forward(req, res)).
> > I don't see this in localhost acces (neither do i expect to see it).
> > The jsp is executed the markup is returned to the client, everyone is
> happy.
> > Now what happens in _this_clients_ installation:
> >
> > Browser calls http://server/blub
> > I see following in the access log
>
> Where this access log is configured?
>

Thank you for this excellent question.
It is indeed configured by application logback.xml and not server.xml :

<appender name="ACCESS_LOG"
class="ch.qos.logback.core.rolling.RollingFileAppender">
     <file>/xxx/${INSTANCE}/logs/app/tomcat.access.log</file>
     <rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

 <fileNamePattern>/xxx/${INSTANCE}/logs/app/tomcat.access.log.%d{yyyy-MM-dd}.gz</fileNamePattern>
         <maxHistory>${MAX_HISTORY}</maxHistory>
     </rollingPolicy>

     <encoder>
         <pattern>[%X{instanceId}] %X{remoteAddr} - %X{remoteUser}
[%d{dd/MMM/yyyy:HH:mm:ss Z}] %X{requestUrl} %X{responseStatus}
%X{responseContentLength} &quot;%X{requestReferer}&quot;
&quot;%X{requestUserAgent}&quot;%n%xEx</pattern>
     </encoder>
 </appender>


 <logger name="ACCESS_LOG" additivity="false">
     <level value="INFO"/>
     <appender-ref ref="ACCESS_LOG"/>
 </logger>

This ACCESS_LOG is used by a Filter
which is referenced (and instantiated) by spring and not by web.xml

So right now I don't really understand what this filter is logging, because
it also adds a response wrapper and logs after the request has been
chained...

Thanks for your time.

regards
Leon

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message