Logging query terms in RT

Hi,

I’m supporting an instance of RT, and have a requirement to log all queries made in RT by our users, including all terms used to create the query.

I can capture the terms used in Simple Searches as part of a POST request within the Apache logs, so that problem is solved.

But I can’t find any mechanism for logging the terms used to build more complex queries in the Query Builder. I’ve turned on the Statement log, and all other logging, at ‘info’ level. However, RT still doesn’t capture the information I need. The only place I’ve found this information stored at all is within the a_session longblob in the sessions table on the database - but it’s not that nice to extract the individual terms from that. I’ve also looked on the Wiki and the forums without luck.

Is there anything I’m missing here, or will this involve some customisation?

I’m using version 3.8.9, on a MySQL version 5.1.52.

Many thanks in advance,

Guy

Please consider the environment before printing this email.

This message should be regarded as confidential. If you have received this email in error please notify the sender and destroy it immediately.

Statements of intent shall only become binding when confirmed in hard copy by an authorised signatory.

The contents of this email may relate to dealings with other companies under the control of BAE Systems plc details of which can be found at http://www.baesystems.com/Businesses/index.htm.

Detica Limited is a BAE Systems company trading as BAE Systems Detica.
Detica Limited is registered in England and Wales under No: 1337451.
Registered office: Surrey Research Park, Guildford, Surrey, GU2 7YP, England.

Hi,

I’m supporting an instance of RT, and have a requirement to log all queries made in RT by our
users, including all terms used to create the query.

I can capture the terms used in Simple Searches as part of a POST request within the Apache
logs, so that problem is solved.

But I can’t find any mechanism for logging the terms used to build more complex queries in the
Query Builder. I’ve turned on the Statement log, and all other logging, at ‘info’ level.
However, RT still doesn’t capture the information I need. The only place I’ve found this
information stored at all is within the a_session longblob in the sessions table on the
database - but it’s not that nice to extract the individual terms from that. I’ve also looked
on the Wiki and the forums without luck.

This would be easier to do at the database level. It’ll be too many
queries, but StatementLog will log too many queries also.

I’m curious why StatementLog isn’t sufficient.

-kevin

Thanks for the response, DB logging might be the way I have to go.

Oddly, StatementLog doesn’t log anything when submitting a query from Query Builder. Doesn’t even log that the database was hit at all.

I was equally curious about this!

-GuyFrom: rt-users-bounces@lists.bestpractical.com on behalf of Kevin Falcone
Sent: Wed 16/11/2011 16:57
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Logging query terms in RT

Hi,

I’m supporting an instance of RT, and have a requirement to log all queries made in RT by our
users, including all terms used to create the query.

I can capture the terms used in Simple Searches as part of a POST request within the Apache
logs, so that problem is solved.

But I can’t find any mechanism for logging the terms used to build more complex queries in the
Query Builder. I’ve turned on the Statement log, and all other logging, at ‘info’ level.
However, RT still doesn’t capture the information I need. The only place I’ve found this
information stored at all is within the a_session longblob in the sessions table on the
database - but it’s not that nice to extract the individual terms from that. I’ve also looked
on the Wiki and the forums without luck.

This would be easier to do at the database level. It’ll be too many
queries, but StatementLog will log too many queries also.

I’m curious why StatementLog isn’t sufficient.

-kevin

Please consider the environment before printing this email.

This message should be regarded as confidential. If you have received this email in error please notify the sender and destroy it immediately.

Statements of intent shall only become binding when confirmed in hard copy by an authorised signatory.

The contents of this email may relate to dealings with other companies under the control of BAE Systems plc details of which can be found at http://www.baesystems.com/Businesses/index.htm.

Detica Limited is a BAE Systems company trading as BAE Systems Detica.
Detica Limited is registered in England and Wales under No: 1337451.
Registered office: Surrey Research Park, Guildford, Surrey, GU2 7YP, England.

Thanks for the response, DB logging might be the way I have to go.

Oddly, StatementLog doesn’t log anything when submitting a query from Query Builder. Doesn’t
even log that the database was hit at all.

I was equally curious about this!

Setting it to ‘info’ requires you to have your log system set to log
‘info’. Try temporarily setting it to ‘error’.

Also, keep in mind that StatementLog is a performance hit.

On RT4 you can see the statement log for your session in the UI under
Tools.

-kevin