How can I log SQL statements in Jmix?

Hi there,
I want to log SQL statements to a log.
In cuba-platform it was in

<logger name="eclipselink.sql" level="DEBUG"/>

in this page : Useful Loggers - CUBA Platform. Developer’s Manual
But can’t in jmix show sql-query.

Can you advice me?

Thanks,
Nurmuhammad

in application.properties you can set

logging:
    level:
        eclipselink:
            logging:
                sql: debug
1 Like

Thanks Tien Vu. it works!

In any new project you have the following line in appplication.properties:

# 'debug' level logs SQL generated by EclipseLink ORM
logging.level.eclipselink.logging.sql = info

in Cuba there was a log file written with the debug level.

With the jmix setting i get the information in the debugger window.

My problem now is, that i get a
SQLIntegrityConstraintViolationException: (conn=525454) Cannot add or update a child row: a foreign key constraint fails (pektos_lager.orders_pos, CONSTRAINT orders_Lot_Id FOREIGN KEY (Lot_Id) REFERENCES art_lot (Lot_Id))

This is erasing the debug window and i dont know which sql command did lead to this error. If there would be a file, this would be recorded.

How to get my logfile back ?

Thanks
Felix

Try click there
image

Dear Oleg
Thank you a lot for your hint !
I was asking for a file, so later in the production environment too, i have a log what the clients did :wink:
Regards
Felix