I'd like to use P6Spy with Quarkus but am unable to configure it by following generic instructions. Has anyone managed to get these two working together?
Asked
Active
Viewed 373 times
0
-
I have a question relative to this question. Can you help me? https://stackoverflow.com/questions/74938286/config-p6spy-on-quarkus-log-result-sql – Thor Dec 28 '22 at 09:28
-
I have a question relative to this question. Can you help me? https://stackoverflow.com/questions/74938286/config-p6spy-on-quarkus-log-result-sql – Thor Dec 28 '22 at 09:30
1 Answers
0
P6Spy is available on Maven. I was unable to get the latest version working so I'm using 1.3. Adapt the following procedure as per the actual driver you're using (in my case oracle.jdbc.driver.OracleDriver
).
- Add P6Spy dependency to
pom.xml
<dependency>
<groupId>p6spy</groupId>
<artifactId>p6spy</artifactId>
<version>1.3</version>
</dependency>
- Create
src\main\resources\spy.properties
with the following content:
module.log=com.p6spy.engine.logging.P6LogFactory
realdriver=oracle.jdbc.driver.OracleDriver
deregisterdrivers=false
outagedetection=false
filter=false
autoflush = true
excludecategories=info,debug,result,batch
logfile = C:/temp/spy.log
reloadproperties=false
reloadpropertiesinterval=60
useprefix=false
appender=com.p6spy.engine.logging.appender.FileLogger
append=true
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=p6spy - %m%n
log4j.logger.p6spy=INFO,STDOUT
Replace
quarkus.datasource.jdbc.driver=oracle.jdbc.driver.OracleDriver
withquarkus.datasource.jdbc.driver=com.p6spy.engine.spy.P6SpyDriver
SQL queries should now get logged to
logfile
(in my case C:\temp\spy.log)

geca
- 2,711
- 2
- 17
- 26