lasso 9 console tips and question AGAIN

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

lasso 9 console tips and question AGAIN

mail
I didn't get an answer on the last go at asking...

How do I get Lasso 9 to automatically log all MySQL statements to the
console as was the case in earlier versions of Lasso?

I did edit the Lasso Log Book Settings and checked off "Console" for the
SQL item and I also tried putting this tag at the top of the script
page:

   log_setDestination(log_level_sql,log_destination_console)

Still do not see MySQL statements.

I want to see the MySQL statement that Lasso sends to MySQL...

Michael

Michael Collins, Web Systems Engineer

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9 console tips and question AGAIN

Jolle Carlestam-3
11 aug 2013 kl. 07:06 skrev <[hidden email]>:

> I want to see the MySQL statement that Lasso sends to MySQL...

I've never seen a need to have ALL sql queries flood the log table since most of them work as I expect them to do. What I do is add a
log_critical(action_statement)
in the inlines I want to examine.

If that's to cumbersome to write I suggest you create a method that does it for you.

HDB
Jolle

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9 console tips and question AGAIN

Brad Lindsay
In reply to this post by mail
On 8/11/13, 1:06 AM, [hidden email] wrote:
> I didn't get an answer on the last go at asking...
>
> How do I get Lasso 9 to automatically log all MySQL statements to the
> console as was the case in earlier versions of Lasso?

In my testing of 9.2.6, this option in the admin doesn't seem to work -
I can't get SQL logged to the log file or table. Also, when I restart
the instance, my log settings get reset. I would suggest reporting this
to LassoSoft through [hidden email].

As mentioned, it's probably best not to log every SQL statement. I've
done that on production servers before, creating files of multiple
gigabytes that I've had to remember to rotate. It was fine on a system
only actively used by 50-60 users a day, but boy did it waste space and
heaven help us if something came up and there was a spike of users who
needed to get in. I won't deny that it didn't help us track a couple of
things down, but overall, I'd say it's not worth it.

Also, as mentioned by others, you could do
[log_critical(action_statement)] everywhere. If you really want this
functionality, I'd go with Jolle's recommendation and create your own
method named [inline_withLog] and use that to wrap your inlines. Quick
(untested) example:

// put in a file in LassoStartup
//
define inline_withLog(...) => {
     fail_if(!givenBlock, 'Inline requires a givenBlock')

     local(gb) = givenBlock
     inline(:#rest) => {
         log_critical(action_statement)
         #gb()
     }
}


// You can then use it in place of normal inlines
inline_withLog(-database='myDB', -sql='SELECT * FROM test',
-maxRecords='all')


Brad

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9 console tips and question AGAIN

fletcher sandbeck-2
In reply to this post by mail

On Aug 10, 2013, at 10:06 PM, [hidden email] wrote:

> I didn't get an answer on the last go at asking...
>
> How do I get Lasso 9 to automatically log all MySQL statements to the
> console as was the case in earlier versions of Lasso?
>
> I did edit the Lasso Log Book Settings and checked off "Console" for the
> SQL item and I also tried putting this tag at the top of the script
> page:
>
>   log_setDestination(log_level_sql,log_destination_console)
>
> Still do not see MySQL statements.
>
> I want to see the MySQL statement that Lasso sends to MySQL…

Another option might be to watch the log from the MySQL side.

[fletcher]


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9 console tips and question AGAIN

Brad Lindsay
On 8/11/13, 12:57 PM, Fletcher Sandbeck wrote:
> Another option might be to watch the log from the MySQL side.

For reference:
    http://dev.mysql.com/doc/refman/5.1/en/query-log.html

Brad

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>