9 Replies Latest reply on Dec 13, 2011 8:31 AM by FCallanan

    Log Every Script That Runs?

    gdurniak

      I would like to see a log of every script users run, to help find the cause of random BeachBalls

       

      ... without actually editing each script, to put in a log step or log function ( we have hundreds )

       

      Any chance this exists under the hood somewhere?

       

      FileMaker 10

       

      thanks

      greg

       

      PS

      SQL offers a query log option, that even records the time to complete

        • 1. Re: Log Every Script That Runs?
          Stephen Huston

          Hi Greg,

           

          Sorry, no existing FM process will do this with FileMaker without creating a script to log this, and calling that script from within every other script. You can capture the names of runing scripts from within the script that way, but what a PITA to implement and keep up. And it would probabaly create a huge log and contribute to more beachballs.

           

          From FM Server, if you are logging the server you might be able to leanr something, but parsing out server logs is frankly beyond my attention span.

           

          I am not aware of any internal FM pre-existing goodie that can do this.

           

          To uncover the beachball causes, pay special attention to backup timing and the use of scripts which require the resolution of unstored calculations for record displays, especially in list view.

           

          Unstored calcs having to resolve before a screen can refresh is the one I encounter most often.

           

          Stephen Huston

          • 2. Re: Log Every Script That Runs?
            psijmons

            Greg,

             

            the beach balls are most probably not random. Ask the users at which action they see this happen most frequently. Then focus on the few scripts that you can pinpoint this way and analyze those scripts with the free tool FMBench (http://fmbench.com/). This requires some simple copy/paste actions around critical steps in the script which you can disable or remove later but the timestamped log file that will be created is very revealing.

             

            Once you get a better understanding of the problematic steps, you can go through the rest of your solution to see how you can improve speed possibly without the copy/paste steps, or at least you will be more aware which steps you need to check in detail.

             

            Peter

            • 3. Re: Log Every Script That Runs?
              RayCologon

              Hi Greg,

               

              As Stephen and Peter have said, there's no built-in trace feature that you can simply turn on.

               

              However, with copy and paste, adding a log call to the top and bottom of each script (ie a call to a sub-script that opens and closes the log entry for each run of the script) is a matter of a few seconds. So, by extension, applying the change to a few hundred scripts should take only a matter of minutes.

               

              By placing the logging code into a sub-script, you'll make it possible to enable and disable logging for the whole solution (or modify its behavior) from one place. And provided you implement the sub-script process efficiently, it won't significantly impact performance. Meanwhile, you may find that the script logs produced provide a range of useful information about usage patterns for the solution, not just performance metrics.

               

              Regards,

              Ray

              ------------------------------------------------

              R J Cologon, Ph.D.

              FileMaker Certified Developer

              Author, FileMaker Pro 10 Bible

              NightWing Enterprises, Melbourne, Australia

              http://www.nightwingenterprises.com

              ------------------------------------------------

              • 4. Re: Log Every Script That Runs?
                gdurniak

                Thanks for the answers

                 

                I have created a sub script, to create log records by Applescript

                 

                This way I don't have to switch layouts, and won't lose window focus

                 

                This is yet another Feature Request ...

                 

                greg

                • 5. Re: Log Every Script That Runs?
                  CarstenLevin

                  Hi Gdurniak,

                   

                  Creating log's with Applescript is very platform dependant and it is a fragile solution.

                   

                  You can do it with scripting alone, also without loosing window focus. When you want to create a log entry then just create a new window, do whatever you need and close that window again. You are now back where you started.

                   

                  Best regards


                  Carsten

                  • 6. Re: Log Every Script That Runs?

                    Hi Greg & Carsten,

                     

                    The script log that Ray mentioned is fully described in his FileMaker 10 Bible. I have used it for one part of our in house system and saw no observable performance penalty.

                     

                    It has been a powerful way for monitoring script usage thus complementing a tool like Base Elements for structural analysis, or FMDiff for comparison of the schema between two stages of a file during the course of development.

                     

                    I hope that helps,

                     

                    John

                    Hamilton, NZ

                    • 7. Re: Log Every Script That Runs?
                      gdurniak

                      Fortunately, we have an all Mac Office

                       

                      I did try the New Window / Close Window approach, but it "broke" some scripts, probably because they also flip between windows. It should work, but doesn't

                       

                      greg

                      • 8. Re: Log Every Script That Runs?
                        RayCologon

                        gdurniak wrote:

                        I did try the New Window / Close Window approach, but it "broke" some scripts, probably because they also flip between windows. It should work, but doesn't...

                         

                         

                        Hi Greg,

                         

                        For what it's worth, a "New Window / Close Window" will tend to break scripts that move between windows unless all the added New Window and Close Window commands use explicit and unique names. Once that's taken care of, its a technique that, in my experience, is fast and reliable.

                         

                        Notwithstanding that, it sounds like you have your problem solved for the time being via an Applescript process, so that's great.

                         

                        Cheers,

                        Ray

                        ------------------------------------------------

                        R J Cologon, Ph.D.

                        FileMaker Certified Developer

                        Author, FileMaker Pro 10 Bible

                        NightWing Enterprises, Melbourne, Australia

                        http://www.nightwingenterprises.com

                        ------------------------------------------------

                        • 9. Re: Log Every Script That Runs?
                          FCallanan

                          Apropos to efficiency...

                          RayCologon wrote:

                           

                          And provided you implement the sub-script process efficiently, it won't significantly impact performance.

                          I'm scripting such a sub-script. I capture and pass some parameters (scriptname,status [begin or end]) and calculate others by function (timestamp, accountname, etc.). These criteria are caputred in the new record.

                           

                          My question is about the method of writing the data: Am I correct in believing there's a performance advantage to Auto-Enter by Calculation vs. a half-dozen Set Field scripts? My thinking is that one step is better than 6, though I'm not sure if the Auto-Enter happens on the server or the client.

                           

                          Frank Callanan

                          Camden, Maine