Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Anas Koara
logging sql queries
March 29, 2011 9:45 AM
Answer

Anas Koara

Rank: New Member

Posts: 22

Join Date: January 13, 2011

Recent Posts

is it possible to log mysql queries done by iferay
I have very slow liferay and I doubt it is mysql problem
regards
Jelmer Kuperus
RE: logging sql queries
March 29, 2011 11:02 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html
Hitoshi Ozawa
RE: logging sql queries
March 29, 2011 3:08 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

SZ mentioned in the other duplicate thread about the following settings.
<property name="hibernate.show.sql" value="true"></property>

https://www.liferay.com/community/forums/-/message_boards/message/8055410?_19_preview=false

In fact, you're able to set the following property in portal-ext.properties. Be sure to turn it off afterward because it slows the server. Nevertheless, it's probably better to query log and do performance tuning on the database so you'll be able to get performance statistic data.

hibernate.show_sql=false
Jelmer Kuperus
RE: logging sql queries
March 29, 2011 10:46 PM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

There is also p6spy but since he is most interested in slow running queries the mysql log is probably most appropriate
Anas Koara
RE: logging sql queries
March 30, 2011 10:09 AM
Answer

Anas Koara

Rank: New Member

Posts: 22

Join Date: January 13, 2011

Recent Posts

it is now showing the queries but it look like this
Hibernate: insert into CalEvent (uuid_, groupId, companyId, userId, userName, createDate, modifiedDate, title, description, startDate, endDate, durationHour, durationMinute, allDay, timeZoneSensitive, type_, repeating, recurrence, remindBy, firstReminder, secondReminder, eventId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

how can I get what actual data is passed

Regards
Hitoshi Ozawa
RE: logging sql queries
March 30, 2011 12:07 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

it is now showing the queries but it look like this
Hibernate: insert into CalEvent (uuid_, groupId, companyId, userId, userName, createDate, modifiedDate, title, description, startDate, endDate, durationHour, durationMinute, allDay, timeZoneSensitive, type_, repeating, recurrence, remindBy, firstReminder, secondReminder, eventId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)


The above sql statement should be in the xml definition file.
Anas Koara
RE: logging sql queries
March 31, 2011 7:19 AM
Answer

Anas Koara

Rank: New Member

Posts: 22

Join Date: January 13, 2011

Recent Posts

jelmer kuperus:
There is also p6spy but since he is most interested in slow running queries the mysql log is probably most appropriate



hello
I read about p6spy and it is very good choice
how can i setup liferay to use p6spy
regards
Corné Aussems
RE: logging sql queries
March 13, 2012 9:55 AM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1270

Join Date: October 3, 2006

Recent Posts

http://www.liferay.com/web/miguel.pastor/blog/-/blogs/10243286