<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VolkomenJuist.nl &#187; RequestLogger</title>
	<atom:link href="http://www.volkomenjuist.nl/blog/tag/requestlogger/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.volkomenjuist.nl/blog</link>
	<description>Juist! Volkomen Juist!</description>
	<lastBuildDate>Mon, 08 Mar 2010 19:58:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Wicket&#8217;s RequestLogger</title>
		<link>http://www.volkomenjuist.nl/blog/2009/04/08/wicket-requestlogger/</link>
		<comments>http://www.volkomenjuist.nl/blog/2009/04/08/wicket-requestlogger/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 19:20:31 +0000</pubDate>
		<dc:creator>Stefanovich</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Wicket]]></category>
		<category><![CDATA[RequestLogger]]></category>

		<guid isPermaLink="false">http://www.volkomenjuist.nl/blog/?p=262</guid>
		<description><![CDATA[Wicket provides you with a build-in request logger. It can give you a lot of information. See also example below. To activate this logger you have to enable the logger and setup (in our case) some Log4j configuration. In this post I&#8217;ll show you how to get this done. The example below shows you how [...]]]></description>
			<content:encoded><![CDATA[<p>Wicket provides you with a build-in request logger. It can give you a lot of information. See also example below. To activate this logger you have to enable the logger and setup (in our case) some Log4j configuration. In this post I&#8217;ll show you how to get this done.</p>
<p><span id="more-262"></span><br />
The example below shows you how to enable the requestLogger when the application is started in &#8220;Development&#8221; mode.</p>
<pre class="brush: java; highlight: [5,8];">
//Check if we are not in deployment mode.
if (!DEPLOYMENT.equalsIgnoreCase(getConfigurationType())) {

  //Get the logger
  IRequestLoggerSettings reqLogger = Application.get().getRequestLoggerSettings();

  //Enable the logger
  reqLogger.setRequestLoggerEnabled(true);

  /**
  * Set the window of all the requests that is kept in memory for viewing. Default is 2000, You
  * can set this to 0 then only Sessions data is recorded (number of request, total time, latest
  * size)
  */
  reqLogger.setRequestsWindowSize(3000);
}
</pre>
<p>If you want to log everything to a specific rolling file you can add the following lines to your log4j.properties file. It will create a file for you with a max. size of 10MB. All Wicket requests will be logged into this file and not in the &#8216;general&#8217; log. </p>
<pre class="brush: java;">
log4j.category.org.apache.wicket.protocol.http.RequestLogger = info,reqLogger
log4j.additivity.org.apache.wicket.protocol.http.RequestLogger=false
log4j.appender.reqLogger=org.apache.log4j.RollingFileAppender
log4j.appender.reqLogger.File=D:/logs/wicketRequestLogger.txt
log4j.appender.reqLogger.MaxFileSize=10MB
log4j.appender.reqLogger.MaxBackupIndex=10
log4j.appender.reqLogger.layout=org.apache.log4j.PatternLayout
log4j.appender.reqLogger.layout.ConversionPattern=%d %-5p - %-26.26c{1} - %m\n
</pre>
<p>Example logging:<br />
2009-04-08 16:18:32,878 INFO  &#8211; RequestLogger-<br />
time=687,<br />
event=Interface[target:Login$LoginForm(bodyTag:loginForm),<br />
page: eu.company.desktop.wicket.ui.login.Login(0),<br />
interface: IFormSubmitListener.onFormSubmitted],<br />
response=org.apache.wicket.request.target.basic.RedirectRequestTarget@1c82b58,<br />
sessionid=C488C8A534D1D853FD1F7A80C5647A52.jvm1,<br />
sessionsize=16239,<br />
sessionstart=Wed Apr 08 14:18:23 GMT 2009,<br />
requests=12,<br />
totaltime=3499,<br />
activerequests=1,<br />
maxmem=532M,<br />
total=163M,<br />
used=93M</p>
<p>That&#8217;s it.</p>
<p>Disclaimer: The requestLogger is very powerfull. I just started experimenting with it, so I don&#8217;t know all ins and outs yet. <img src='http://www.volkomenjuist.nl/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
 <img src="http://www.volkomenjuist.nl/blog/wp-content/plugins/feed-statistics.php?view=1&post_id=262" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.volkomenjuist.nl/blog/2009/04/08/wicket-requestlogger/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
