Open source, commercial support.

Http logging and DebugFilter

Community provided content
Register
New page Edit

When debugging a webdav application its very often helpful to see the exact request and responses.

The best way to do this is to use a network sniffing tool like wireshark, but that doesnt work in some important circumstances:

The solution is to use Milton's DebugFilter. This is a Milton filter (NOT a javax.servlet filter!) which writes text files containing each request and response to some directory.

Caution: Using DebugFilter can create ten's of thousands of files in your home directory. This can bring your PC to its knees! Turn it on when you need it then turn it off

 

How to use it

Using servlet configuration:

        <init-param>
            <param-name>filter_0</param-name>
            <param-value>com.bradmcevoy.http.DebugFilter</param-value>
        </init-param>

 

Using Spring configuration:

    <bean id="milton.debug.filter" class="com.bradmcevoy.http.DebugFilter" >
        <constructor-arg value="/somedir"/>
    </bean>

    <bean id="milton.http.manager" class="com.bradmcevoy.http.HttpManager">
        <constructor-arg ref="milton.resource.factory" />
        <property name="filters">
            <list>
                <ref bean="milton.debug.filter" />
            </list>
        </property>
    </bean>

 

 

blog comments powered by Disqus