Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 29th, 2004, 07:56 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Alhambra, ca, USA.
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default AppException Class -Log Error to Event Log

Hello
I used the code in book, page 40, to get error to actually log the info to event log but it just doesn't work.
AppException.vb in Core


Private Sub LogEvent(ByVal message as String)
If Not EventLog.SourceExist("ThePhile.com") Then
EventLog.CreateEventSource("ThePhile.com"), "Application")
end if

EventLog.WriteEntry("ThePhile.com", message, EventLogEntryType.Error)
End Sub

What could be the problem??

  #2 (permalink)  
Old November 29th, 2004, 04:55 PM
Authorized User
 
Join Date: Oct 2004
Location: Melbourne, Victoria, Australia.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I would check the user that the web application is running under, By default the ASP worker Account does not have permissions to create event sources.

  #3 (permalink)  
Old November 30th, 2004, 06:32 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Alhambra, ca, USA.
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mykre, could you give me more details about ASP worker Account not having permission to create event source.
How can I get ASP.NET to have these permissions???

  #4 (permalink)  
Old November 30th, 2004, 05:09 PM
Authorized User
 
Join Date: Oct 2004
Location: Melbourne, Victoria, Australia.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can not!, you need to create an account that has permissions that can access the registry and eventlogs.

My suggestion though is to create the eventlog sources and any custome event logs during setup, there is an article on MSDN that can help with this.

  #5 (permalink)  
Old December 1st, 2004, 08:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can also read the other messages in this forum, or check the readme.htm file in the code download. This is a frequent question.

Eric
  #6 (permalink)  
Old December 3rd, 2004, 08:00 AM
Registered User
 
Join Date: Feb 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you build a website and host it on a server you do not own you cannot get access to the event log. Has anyone changed the code in the log event method so that it logs the event to a SQLserver database instead?

John

  #7 (permalink)  
Old December 6th, 2004, 07:02 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SQL Server logging is not a good idea because many of the problems that get logged are related to DB trouble.

The VB.NET code download has been modified to log to a file, and this is what I prefer.

Eric
  #8 (permalink)  
Old December 7th, 2004, 01:01 PM
Registered User
 
Join Date: Feb 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Eric,
I hadn't thought of that
I am going to stick to writing to a file

John

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to log to server's event log LenexaKS Access VBA 4 March 11th, 2008 12:49 PM
Can't get Log to write the Log.txt file jnbutler BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 3 July 31st, 2007 04:04 AM
Event Log dkspivey ASP.NET 1.0 and 1.1 Basics 3 August 22nd, 2005 11:19 AM
Security exception comes when writing to event log s_vermani BOOK: Beginning ASP.NET 1.0 4 October 21st, 2004 09:17 AM
Event log to a text file jackchua BOOK: ASP.NET Website Programming Problem-Design-Solution 2 May 17th, 2004 09:54 PM



All times are GMT -4. The time now is 05:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.