<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Grails, p6spy and Sql Profiler</title>
	<atom:link href="http://www.piragua.com/2009/06/17/grails-p6spy-and-sql-profiler/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.piragua.com/2009/06/17/grails-p6spy-and-sql-profiler/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 28 Jan 2010 06:39:14 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: j pimmel</title>
		<link>http://www.piragua.com/2009/06/17/grails-p6spy-and-sql-profiler/comment-page-1/#comment-66</link>
		<dc:creator>j pimmel</dc:creator>
		<pubDate>Thu, 08 Oct 2009 21:19:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.piragua.com/?p=35#comment-66</guid>
		<description>I&#039;m trying to get this working in 1.2 and having no luck with the logging output. 

The P6Spy shows green and i get the 3 init messages, driverManager; registeredDriver and reloadProperties.

I have logSql=true in my datasource and am seeing the HSQl dumping to console as i use the app. No SQL statements of further logging appears in P6SPy app os spy.log (they never have)

I followed you examples exactly as above - here is my spy.properties

realdriver=com.mysql.jdbc.Driver
log4j.appender.SQLPROFILER_CLIENT=org.apache.log4j.net.SocketAppender
log4j.appender.SQLPROFILER_CLIENT.RemoteHost=localhost
log4j.appender.SQLPROFILER_CLIENT.Port=4445
log4j.appender.SQLPROFILER_CLIENT.LocationInfo=true
log4j.logger.p6spy=DEBUG,STDOUT,SQLPROFILER_CLIENT

appender=com.p6spy.engine.logging.appender.Log4jLogger

Is there anything that needs to be changed in the log4j config of the app? This is what I have

log4j = {
            error &#039;grails.app&#039;, &#039;stdout&#039;, &#039;file&#039;
            root {
                error()
            }
            additivity = true
        }

I also have Grails in Action and nothing in there is helping me resolve this. 

When running the app with &#039;-Dlog4j.debug=true&#039; i get the following output

log4j: Trying to find [log4j.xml] using context classloader java.net.URLClassLoader@10f0625.
log4j: Trying to find [log4j.xml] using org.codehaus.groovy.grails.cli.support.GrailsRootLoader@fd13b5 class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader java.net.URLClassLoader@10f0625.
log4j: Using URL [jar:file:/home/jerome/grails/dist/grails-scripts-1.2-M2.jar!/log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL jar:file:/home/jerome/grails/dist/grails-scripts-1.2-M2.jar!/log4j.properties
log4j: Parsing for [root] with value=[error, NULL].
log4j: Level token is [error].
log4j: Category root set to ERROR
log4j: Parsing appender named &quot;NULL&quot;.
log4j: Parsed &quot;NULL&quot; options.
log4j: Finished configuring.
No authentication for svn repo at ywRepository ...
log4j: setFile called: stacktrace.log, true
log4j: setFile ended
The plugin is disabled therefore nothing needs to be done here.
Running Grails application..
8-Oct-2009 2:18:30 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
8-Oct-2009 2:18:30 PM org.apache.catalina.core.StandardService start
INFO: Starting service Tomcat
8-Oct-2009 2:18:30 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0-snapshot
8-Oct-2009 2:18:30 PM org.apache.catalina.startup.ContextConfig defaultWebConfig
INFO: No default web.xml
8-Oct-2009 2:18:31 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
log4j: Could not find root logger information. Is this OK?
log4j: Parsing for [p6spy] with value=[DEBUG,STDOUT,SQLPROFILER_CLIENT].
log4j: Level token is [DEBUG].
log4j: Category p6spy set to DEBUG
log4j: Parsing appender named &quot;STDOUT&quot;.
log4j:ERROR Could not find value for key log4j.appender.STDOUT
log4j:ERROR Could not instantiate appender named &quot;STDOUT&quot;.
log4j: Parsing appender named &quot;SQLPROFILER_CLIENT&quot;.
log4j: Setting property [port] to [4445].
log4j: Setting property [locationInfo] to [true].
log4j: Setting property [remoteHost] to [localhost].
log4j: Parsed &quot;SQLPROFILER_CLIENT&quot; options.
log4j: Handling log4j.additivity.p6spy=[null]
log4j: Finished configuring.
Server running. Browse to http://localhost:8080/imt-grails-webapp</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to get this working in 1.2 and having no luck with the logging output. </p>
<p>The P6Spy shows green and i get the 3 init messages, driverManager; registeredDriver and reloadProperties.</p>
<p>I have logSql=true in my datasource and am seeing the HSQl dumping to console as i use the app. No SQL statements of further logging appears in P6SPy app os spy.log (they never have)</p>
<p>I followed you examples exactly as above &#8211; here is my spy.properties</p>
<p>realdriver=com.mysql.jdbc.Driver<br />
log4j.appender.SQLPROFILER_CLIENT=org.apache.log4j.net.SocketAppender<br />
log4j.appender.SQLPROFILER_CLIENT.RemoteHost=localhost<br />
log4j.appender.SQLPROFILER_CLIENT.Port=4445<br />
log4j.appender.SQLPROFILER_CLIENT.LocationInfo=true<br />
log4j.logger.p6spy=DEBUG,STDOUT,SQLPROFILER_CLIENT</p>
<p>appender=com.p6spy.engine.logging.appender.Log4jLogger</p>
<p>Is there anything that needs to be changed in the log4j config of the app? This is what I have</p>
<p>log4j = {<br />
            error &#8216;grails.app&#8217;, &#8217;stdout&#8217;, &#8216;file&#8217;<br />
            root {<br />
                error()<br />
            }<br />
            additivity = true<br />
        }</p>
<p>I also have Grails in Action and nothing in there is helping me resolve this. </p>
<p>When running the app with &#8216;-Dlog4j.debug=true&#8217; i get the following output</p>
<p>log4j: Trying to find [log4j.xml] using context classloader java.net.URLClassLoader@10f0625.<br />
log4j: Trying to find [log4j.xml] using org.codehaus.groovy.grails.cli.support.GrailsRootLoader@fd13b5 class loader.<br />
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().<br />
log4j: Trying to find [log4j.properties] using context classloader java.net.URLClassLoader@10f0625.<br />
log4j: Using URL [jar:file:/home/jerome/grails/dist/grails-scripts-1.2-M2.jar!/log4j.properties] for automatic log4j configuration.<br />
log4j: Reading configuration from URL jar:file:/home/jerome/grails/dist/grails-scripts-1.2-M2.jar!/log4j.properties<br />
log4j: Parsing for [root] with value=[error, NULL].<br />
log4j: Level token is [error].<br />
log4j: Category root set to ERROR<br />
log4j: Parsing appender named &#8220;NULL&#8221;.<br />
log4j: Parsed &#8220;NULL&#8221; options.<br />
log4j: Finished configuring.<br />
No authentication for svn repo at ywRepository &#8230;<br />
log4j: setFile called: stacktrace.log, true<br />
log4j: setFile ended<br />
The plugin is disabled therefore nothing needs to be done here.<br />
Running Grails application..<br />
8-Oct-2009 2:18:30 PM org.apache.coyote.http11.Http11Protocol init<br />
INFO: Initializing Coyote HTTP/1.1 on http-8080<br />
8-Oct-2009 2:18:30 PM org.apache.catalina.core.StandardService start<br />
INFO: Starting service Tomcat<br />
8-Oct-2009 2:18:30 PM org.apache.catalina.core.StandardEngine start<br />
INFO: Starting Servlet Engine: Apache Tomcat/6.0-snapshot<br />
8-Oct-2009 2:18:30 PM org.apache.catalina.startup.ContextConfig defaultWebConfig<br />
INFO: No default web.xml<br />
8-Oct-2009 2:18:31 PM org.apache.catalina.core.ApplicationContext log<br />
INFO: Initializing Spring root WebApplicationContext<br />
log4j: Could not find root logger information. Is this OK?<br />
log4j: Parsing for [p6spy] with value=[DEBUG,STDOUT,SQLPROFILER_CLIENT].<br />
log4j: Level token is [DEBUG].<br />
log4j: Category p6spy set to DEBUG<br />
log4j: Parsing appender named &#8220;STDOUT&#8221;.<br />
log4j:ERROR Could not find value for key log4j.appender.STDOUT<br />
log4j:ERROR Could not instantiate appender named &#8220;STDOUT&#8221;.<br />
log4j: Parsing appender named &#8220;SQLPROFILER_CLIENT&#8221;.<br />
log4j: Setting property [port] to [4445].<br />
log4j: Setting property [locationInfo] to [true].<br />
log4j: Setting property [remoteHost] to [localhost].<br />
log4j: Parsed &#8220;SQLPROFILER_CLIENT&#8221; options.<br />
log4j: Handling log4j.additivity.p6spy=[null]<br />
log4j: Finished configuring.<br />
Server running. Browse to <a href="http://localhost:8080/imt-grails-webapp" onclick="javascript:pageTracker._trackPageview('/outbound/comment/localhost:8080');" rel="nofollow">http://localhost:8080/imt-grails-webapp</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted Naleid &#187; Batch Import Performance with Grails and MySQL</title>
		<link>http://www.piragua.com/2009/06/17/grails-p6spy-and-sql-profiler/comment-page-1/#comment-64</link>
		<dc:creator>Ted Naleid &#187; Batch Import Performance with Grails and MySQL</dc:creator>
		<pubDate>Thu, 01 Oct 2009 05:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.piragua.com/?p=35#comment-64</guid>
		<description>[...] Mike Hugo has a great post on using the p6spy plugin with the JDBC SQL profiler. [...]</description>
		<content:encoded><![CDATA[<p>[...] Mike Hugo has a great post on using the p6spy plugin with the JDBC SQL profiler. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wayne Stidolph</title>
		<link>http://www.piragua.com/2009/06/17/grails-p6spy-and-sql-profiler/comment-page-1/#comment-63</link>
		<dc:creator>Wayne Stidolph</dc:creator>
		<pubDate>Thu, 27 Aug 2009 16:44:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.piragua.com/?p=35#comment-63</guid>
		<description>This looks really useful! But, I also didn&#039;t see anything much ni the UI except &quot;Connected to p6spy&quot; ... looking at teh console for sqlprofiler I see that the data flowing to sqlprofiler isn&#039;t being parsed right:

[Thread-4] DEBUG org.jahia.sqlprofiler.gui.LoggingReceiver - Starting to get data
Exception in thread &quot;Thread-2&quot; java.lang.NumberFormatException: For input string: &quot;08:39:51&quot;
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
	at java.lang.Long.parseLong(Long.java:412)
	at java.lang.Long.parseLong(Long.java:461)
	at org.jahia.sqlprofiler.QueryEntry.parseP6Encoding(QueryEntry.java:134)
	at org.jahia.sqlprofiler.QueryEntry.(QueryEntry.java:35)
	at org.jahia.sqlprofiler.gui.ProfileStatementTableModel.processP6Event(ProfileStatementTableModel.java:81)
	at org.jahia.sqlprofiler.gui.LoggerTableModel$Processor.run(LoggerTableModel.java:137)
	at java.lang.Thread.run(Thread.java:619)

Did you do anything to sqlprofiler to get it to parse the inbound string properly?</description>
		<content:encoded><![CDATA[<p>This looks really useful! But, I also didn&#8217;t see anything much ni the UI except &#8220;Connected to p6spy&#8221; &#8230; looking at teh console for sqlprofiler I see that the data flowing to sqlprofiler isn&#8217;t being parsed right:</p>
<p>[Thread-4] DEBUG org.jahia.sqlprofiler.gui.LoggingReceiver &#8211; Starting to get data<br />
Exception in thread &#8220;Thread-2&#8243; java.lang.NumberFormatException: For input string: &#8220;08:39:51&#8243;<br />
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)<br />
	at java.lang.Long.parseLong(Long.java:412)<br />
	at java.lang.Long.parseLong(Long.java:461)<br />
	at org.jahia.sqlprofiler.QueryEntry.parseP6Encoding(QueryEntry.java:134)<br />
	at org.jahia.sqlprofiler.QueryEntry.(QueryEntry.java:35)<br />
	at org.jahia.sqlprofiler.gui.ProfileStatementTableModel.processP6Event(ProfileStatementTableModel.java:81)<br />
	at org.jahia.sqlprofiler.gui.LoggerTableModel$Processor.run(LoggerTableModel.java:137)<br />
	at java.lang.Thread.run(Thread.java:619)</p>
<p>Did you do anything to sqlprofiler to get it to parse the inbound string properly?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sakuraba</title>
		<link>http://www.piragua.com/2009/06/17/grails-p6spy-and-sql-profiler/comment-page-1/#comment-58</link>
		<dc:creator>Sakuraba</dc:creator>
		<pubDate>Wed, 24 Jun 2009 09:39:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.piragua.com/?p=35#comment-58</guid>
		<description>I see &quot;Connected to p6spy&quot; in the UI, but I dont get any output in the UI.</description>
		<content:encoded><![CDATA[<p>I see &#8220;Connected to p6spy&#8221; in the UI, but I dont get any output in the UI.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pupkin</title>
		<link>http://www.piragua.com/2009/06/17/grails-p6spy-and-sql-profiler/comment-page-1/#comment-57</link>
		<dc:creator>pupkin</dc:creator>
		<pubDate>Mon, 22 Jun 2009 07:32:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.piragua.com/?p=35#comment-57</guid>
		<description>Very interesting and will be helpful in my stuff. Thanks for the post.</description>
		<content:encoded><![CDATA[<p>Very interesting and will be helpful in my stuff. Thanks for the post.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
