KonaKart Community Forum

Installation / Configuration => Configuration of KonaKart => Topic started by: smudge on July 17, 2018, 02:45:33 pm

Title: How do I see what SQL is being run by KonaKart?
Post by: smudge on July 17, 2018, 02:45:33 pm
How do I see what SQL is being run by KonaKart?

Thanks.
Title: Re: How do I see what SQL is being run by KonaKart?
Post by: Brian on July 17, 2018, 04:10:09 pm
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:

        <!-- 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).