jasperreportsuser Posted July 10, 2014 Posted July 10, 2014 I've seen some discussion on how to log generated SQL on jasper server and iReport. Is it possible to do so in Jaspersoft Studio?
marianol Posted July 10, 2014 Posted July 10, 2014 Good question.. normaly in JSS you write the query so it's pretty straight forward, what you write is sent to the DB, the only case you may find that useful is with marameter subtitution (if your query is using $P{} or $X{}) in that case you can use the JR query logging. To do this add "log4j.logger.net.sf.jasperreports.engine.query.JRJdbcQueryExecuter=debug" to your JSS jasperreports.properties file, check this thread http://community.jaspersoft.com/questions/526007/logging-sql-query-executed
jasperreportsuser Posted July 10, 2014 Author Posted July 10, 2014 Thank you for the reply. You are exactly right about the reasoning. I am trying to dig deeper into what is going on in my report and want to see what SQL results from my $X expressions. I believe your link is again referring to the Jasper Server. As I do not administrate the Jasper server I would like to view the SQL generated in Jaspersoft Studio. I searched the install folder for jasperreports.properties and it doesn't appear to be present. Any further suggestions?
marianol Posted July 10, 2014 Posted July 10, 2014 Actually since that logger is in JasperReports it will be the same for JSS or JasperServer. To change the jasperreports.properties file in JasperSoft Studio you have a UI to get there go to: MyReports -> Properties -> Jaspersoft Studio group -> Properties -> Use Workspace Settings -> Configure Workspace Settings and then you can add your log4j.logger.net.sf.jasperreports.engine.query.JRJdbcQueryExecuter=debug But now that I look into it the log4J does not look like is configured by default in JSS so here is the info to configure it http://community.jaspersoft.com/wiki/configuring-apache-commons-logging-and-log4j-jaspersoft-studio
kaushik_3 Posted October 24, 2016 Posted October 24, 2016 I tried the configuration as defined http://community.jaspersoft.com/wiki/configuring-apache-commons-logging-and-log4j-jaspersoft-studio and added og4j.logger.net.sf.jasperreports.engine.query.JRJdbcQueryExecuter=debug as mentioned above however it still does not work. Can I get some help.
Solution kkumlien Posted July 14, 2017 Solution Posted July 14, 2017 Java Util Logging (but not Log4j) should work as per Configuring Apache Commons Logging and Log4J in Jaspersoft Studio if you set this in log.properties:net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.level = FINE[/code]and comment out the default level for the FileHandler:# java.util.logging.FileHandler.level = INFO[/code]Also make sure java.util.logging.FileHandler.patternand -Dorg.apache.commons.logging.diagnostics.dest point to different files. The file set in java.util.logging.FileHandler.pattern should contain your SQL statements.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now