• Possible Bug

    By Michael Davis 1 decade ago

    Hello - great idea for a product. I just downloaded and began using it one of my dbs.



    I think I found a bug.



    Perhaps you can test this too.



    I found if I set these two values IN THIS ORDER:

    logger.LogErrorsToMail = True

    logger.LogMailRecipients = configDoc.GetItemValue("SendTo")(0)



    All worked well.

    If I set them in THIS ORDER:

    logger.LogMailRecipients = configDoc.GetItemValue("SendTo")(0)

    logger.LogErrorsToMail = True



    The emails did not send on error.



    Any ideas?

    thank you,

    Michael Davis

    • Working As Designed... ;-)

      By Corey Davis 1 decade ago

      Hi Michael! Thank you for the feedback. This is working as designed.



      Okay, I'm joking. I've just always wanted to say that! ;-)



      Here is what is happening…when you set LogErrorsToMail = TRUE you are actually doing more than

      just turning on this feature. The log engine is actually beginning the process of creating the log

      document that will be mailed out. By setting the recipients first there is no existing log document to

      write the recipient list to and therefore it silently exits that function.



      So, what to do? I could easily (I think) just add some code to the LogMailRecipients property to set

      LogErrorsToMail = TRUE automatically assuming that if you add recipients you obviously mean to use

      this feature. My dilemma is that without the developer specifically setting that property to True should

      the engine automatically turn it on? And, if so, should I do this to all other properties where this problem

      may arise? Or should I stop silently exiting functions when certain parameters are not met and instead

      write an error to the console (I cannot write to the log because a log document may not be enabled)?



      I'll post this to my blog (http://www.conxsys.com/blog) and see what responses I get back, but would

      be very interested to hear what you think either here or on the blog.

      • Problem fixed!

        By Corey Davis 1 decade ago

        I know I never got around to blogging this as I said I would, but that was because I had figured out another

        way to handle the problem. Look at v1.0 Beta 5 and you will find the fix. Essentially it now caches the

        settings (LogMailRecipient, LogMailSubject, etc.). This is how it should have worked from the beginning, it

        just took you to point the problem out to me for me to see it. Thanks, Michael! And please let me know if

        you find anything else.