Skip to content

gehel/tomcat-valves

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tomcat-valves

Custom Tomcat valves to help debug a few special cases in Tomcat applications.

SessionSerializableCheckerValve

This valve will check all session attributes on each request and log a warning if one of the attribute is not serializable. We check that the object's class implements java.io.Serializable and that it can be written to an ObjectOutputStream.

To use it, add the following line in your server.xml, as part of an Engine, Host or Context:

<valve classname="ch.ledcom.tomcat.valves.SessionSerializableCheckerValve">

SessionSizeValve

This valve will print the size of each session.

To use it, add the following line in your server.xml, as part of an Engine, Host or Context :

<valve classname="ch.ledcom.tomcat.valves.SessionSizeValve">

RequestAllocationRecorderValve

This valve will print the amount of memory allocated by each HTTP request.

The following system properties can be used to further configure it :

ch.ledcom.tomcat.valves.allocation.RequestAllocationRecorderValve.disabled
Disable the valve
ch.ledcom.tomcat.valves.allocation.RequestAllocationRecorderValve.printSummary
Will also print a summary of the allocation for all requests
ch.ledcom.tomcat.valves.allocation.RequestAllocationRecorderValve.printSummary.period
Print the summary for one in period requests

AllocationAdvice

Can be used with Spring AOP to record allocation in part of your code. See code for details.

Build Status Bitdeli Badge

About

Custom Tomcat valves

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages