3 Replies Latest reply on Nov 11, 2010 7:36 AM by luis_1

    suppress writing of messages to the log file?

    luis_1

      Title

      suppress writing of messages to the log file?

      Your post

      Hi all,

      Is there a way to selectively prevent error messages from being written to the log files? I don't want 401 errors (No records match the request) to be logged. I have serveral scripts where I do something like the code snippet at the bottom of this message, that generate the 401 entries in the log file. The service provider where I run my application claims that I produce a lot of these errors and this causes the server to crash. I doubt this is the cause of the crashes, but I would still like to avoid generating the errors if possible so I don't have to enter into an argument with my provider. Also, because this is a shared server, logging cannot be turned off altogether.

      Thanks a lot,

      Luis

      ---

      Set Error Capture [On]

      Enter Find Mode []

      Set Field[X; lookup_val]

      Perform Find[]

      If [Get(FoundCount) > 0]

      <do something>

      End If

        • 1. Re: suppress writing of messages to the log file?
          philmodjunk

          Simply logging an error should not cause the server to crash. If the service provider fails to provide enough hard drive space for the log files and doesn't periodically purge or archive the log files, that could cause problems when the hard drive or a partition fills up.

          As this is a very common use for a script, you might want to check out other hosting services to see what they have to offer.

          • 2. Re: suppress writing of messages to the log file?
            philmodjunk

            I suppose you could modify scripts to avoid the error conditions but that would get a bit rediculous.

            New record/Request
            Set Field [YourTable::yourField ; "xxxxxxxxxx"]
            Enter Find mode []
            //specify your find criteria
            New Record/Request
            Set Field [YourTable::yourField ; "xxxxxxxxxx"]
            Perform Find[]
            If [Get ( FoundCount ) = 1 /* only temp dummy record found */]
              //do what you need when no records found
            End If
            Enter Find mode []
            Set Field [YourTable::yourField ; "xxxxxxxxxx"]
            Perform Find []
            Delete Record [no dialog]

            And that only handles finds, You'd have to play similar games with Go To Related Records and Go To Record [Next ; Exit after Last] which can also trigger these "error" messages to be logged.

            • 3. Re: suppress writing of messages to the log file?
              luis_1

              Thanks a lot PhiModJunk, the dummy record approach would take care of the issue, but it is too much trouble for what you correctly say should be handled by the provider. I've asked them if they are managing their log space correctly, and to also look elsewhere for the causes of the crashes.

              thanks again