You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Art Licis <ar...@gmail.com> on 2017/12/11 01:20:58 UTC

Re: HTTP Access log

Yes, it is possible. To do that, you just need to add RequestLogHandler to
jetty handler collection. That's how you do it:

By default, Jetty is configured via jetty.xml (imported in activemq.xml):
<import resource="jetty.xml"/>

jetty.xml is a regular Spring configuration file, and some handlers are
already defined. So you just create an additional one for request logging,
and add to handlers collection:
<!-- ............... -->

    <bean id="requestLogHandler"
class="org.eclipse.jetty.server.handler.RequestLogHandler">
        <property name="requestLog">
            <bean class="org.eclipse.jetty.server.NCSARequestLog">
                <property name="filename"
value="/var/opt/activemq/logs/yyyy_mm_dd.request.log" />
                <property name="filenameDateFormat" value="yyyy_MM_dd" />
                <property name="retainDays" value="14" />
                <property name="append" value="true" />
                <property name="extended" value="true" />
                <property name="logCookies" value="false" />
                <property name="logTimeZone" value="GMT" />
            </bean>
        </property>
    </bean>

        <bean id="secHandlerCollection"
class="org.eclipse.jetty.server.handler.HandlerCollection">
                <property name="handlers">
                        <list>
                            <ref bean="rewriteHandler"/>
                            <!-- ..........-->
                            <ref bean="requestLogHandler"/>
                        </list>
                </property>
        </bean>


The rest is a matter of fine-tuning.

- Art


On Thu, Oct 19, 2017 at 2:26 PM, davidh <da...@agenor.co.uk> wrote:

> We are using ActiveMQ REST API <http://activemq.apache.org/rest.html>   to
> publish messages on topics.
>
> I'd like to be able to track HTTP requests into ActiveMQ, via Jetty, such
> that I can see timestamp, time taken etc.
>
> Is this possible?
>
> I know that AMQ uses Jetty embedded - and ( based on this
> <https://www.eclipse.org/jetty/documentation/9.3.x/
> configuring-jetty-request-logs.html>
> ) should in theory be able to get Jetty to write access logs, but I'm
> struggling to relate this to inclusion in  AMQ control scripts
> <http://activemq.apache.org/unix-shell-script.html>
>
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-
> f2341805.html
>

Re: HTTP Access log

Posted by davidh <da...@agenor.co.uk>.
Hi art.licis

Thanks I will try that out.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html