Author Topic: How do I see what SQL is being run by KonaKart?  (Read 392 times)

smudge

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
How do I see what SQL is being run by KonaKart?
« on: July 17, 2018, 08:45:33 AM »
How do I see what SQL is being run by KonaKart?

Thanks.

Brian

  • Administrator
  • Hero Member
  • *****
  • Posts: 271
    • View Profile
    • KonaKart Website
Re: How do I see what SQL is being run by KonaKart?
« Reply #1 on: July 17, 2018, 10:10:09 AM »
The easiest way is to enable the log4j2 logging in the konakart-logging.xml file.

In webapps/konakart/WEB-INF/classes/konakart-logging.xml you'll find:

Code: [Select]
        <!-- KonaKart Persistence layer - Set to INFO to see the SQL (Set to TRACE to see more detail) -->
        <Logger name="com.konakart.db" level="WARN" additivity="false">
            <AppenderRef ref="STDOUT"/>
            <!-- KonaKart File Logger
            <AppenderRef ref="FILE"/>
            End of KonaKart File Logger -->
        </Logger>

As the comment there states....   Set the level to "INFO" to see the SQL.

By default the server will monitor the changes to konakart-logging.xml and load the new configuration (the monitor frequency is defined at the top of that logging file - the number is in seconds) but in development it's often quicker just to restart tomcat (or whatever you use).