You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by davidh <da...@agenor.co.uk> on 2017/10/19 11:26:36 UTC
HTTP Access log
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
Re: HTTP Access log
Posted by Art Licis <ar...@gmail.com>.
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 Karlovsky Alexey <ye...@gmail.com>.
If you are Mac or Linux user, I can recommend lnav(1).
It's super tool for viewing logs, combine different logs, filtering and etc.
1 http://lnav.org
On 19 Oct 2017 2:26 p.m., "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
>