StartLogging method


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: StartLogging method

  1. #1
    Per Johansson Guest

    StartLogging method

    Can someone please explain how to set the eventlog to overwrite any
    pre-existing file. When I code:

    Call App.StartLogging(App.Path & "\ErrorLog.txt", vbLogToFile)

    everything works fine. But when I change the above to:

    Call App.StartLogging(App.Path & "\ErrorLog.txt", vbLogToFile +
    vbLogOverwrite)

    no file is created.

    Best regards
    Per Johansson



  2. #2
    Rick Rothstein Guest

    Re: StartLogging method

    What happens if you just use vbLogOverwrite by itself instead of combining
    it with vbLogToFile?

    Rick


    "Per Johansson" <Per@systemtech.se> wrote in message
    news:3960867a@news.devx.com...
    > Can someone please explain how to set the eventlog to overwrite any
    > pre-existing file. When I code:
    >
    > Call App.StartLogging(App.Path & "\ErrorLog.txt", vbLogToFile)
    >
    > everything works fine. But when I change the above to:
    >
    > Call App.StartLogging(App.Path & "\ErrorLog.txt", vbLogToFile +
    > vbLogOverwrite)
    >
    > no file is created.
    >
    > Best regards
    > Per Johansson
    >
    >




  3. #3
    Per Johansson Guest

    Re: StartLogging method


    Rick Rothstein <rick_newsgroup@email.com> skrev i
    diskussionsgruppsmeddelandet:3960985d$1@news.devx.com...
    > What happens if you just use vbLogOverwrite by itself instead of combining
    > it with vbLogToFile?


    If I just use vbLogOverwrite nothing changes. That is no log-file is
    created. It would be simple to just delete any previous log-file manually
    before starting to log events, but if the enum exists it must do so for a
    reason...???

    Best regards
    Per Johansson



  4. #4
    Alan Gillott Guest

    Re: StartLogging method

    I've given up on trying to make this work as designed. VB, in spite of
    articals to the contrary on MSDN, seems to have its own view of how this
    works and does it's best to ignore and to quite positively go out of its way
    to thwart anything you want to do. what is quite terrifying is that
    everytime I go to play with this, it appears to work completely differently
    from the last time. This is true both on NT & Win 98. I foolishly left
    logging in a component that steadfastly refused to log anything only to find
    some months later that it had overcome its scruples and was busy logging
    away great gobs of data. I have become quite adept at writing my own logging
    routines - especially after wasting oodles of time on an NT system that
    mysteriously overflowed quite regularly. Reason, the local settings on the
    NT log were No overwrite, keep 7 days. Everytime they booted it was
    automatic that they manually cleared the log: the program ran for a while
    then Offlowed again.

    Moral. VB6 logging is tooooo flakey - keep well away.

    Per Johansson <Per@systemtech.se> wrote in message
    news:3960867a@news.devx.com...
    > Can someone please explain how to set the eventlog to overwrite any
    > pre-existing file. When I code:
    >
    > Call App.StartLogging(App.Path & "\ErrorLog.txt", vbLogToFile)
    >
    > everything works fine. But when I change the above to:
    >
    > Call App.StartLogging(App.Path & "\ErrorLog.txt", vbLogToFile +
    > vbLogOverwrite)
    >
    > no file is created.
    >
    > Best regards
    > Per Johansson
    >
    >




  5. #5
    Michael Culley Guest

    Re: StartLogging method


    Just as side issue - '+' should not be used to combine enums. 'Or' should
    always be used.

    Michael Culley

    "Per Johansson" <Per@systemtech.se> wrote:
    >Can someone please explain how to set the eventlog to overwrite any
    >pre-existing file. When I code:
    >
    > Call App.StartLogging(App.Path & "\ErrorLog.txt", vbLogToFile)
    >
    >everything works fine. But when I change the above to:
    >
    > Call App.StartLogging(App.Path & "\ErrorLog.txt", vbLogToFile +
    >vbLogOverwrite)
    >
    >no file is created.
    >
    >Best regards
    >Per Johansson
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center