-
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
-
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
>
>
-
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
-
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
>
>
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks