Writing into Event Log from an ASP.NET application
If you try to write an entry to events log form an ASP.NET application is probably that you find an exception like this "The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.". The reason is that the ASP.NET process cannot find the source of the entry. You have to create it manually because, by default, the ASP.NET process, cannot do it programmatically. To create it manually you have to add a new entry in the registry (regedit.exe) with the name of your source (in the example TEST under Application log) in the following path "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application". Then, with the following code, you can write your entries.
string sSource;
string sEvent;
sSource = "TEST";
sLog = "Application";
sEvent = "Sample Event";
EventLog.WriteEntry(sSource, sEvent);
Related Links:
http://pranas.net/Tutorials/asp/EventLog.htm (example)
5 Comments:
Well written article.
Can anyone recommend the robust Network Management program for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: N-able N-central change management
? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!
ebook applied physics in radiation oncology http://audiobookscollection.co.uk/Differential-Evolution-A-Practical-Approach-to-Global-Optimization/p147455/ simplified hcg ebook free [url=http://audiobookscollection.co.uk/de/Mac-OS-X-UNIX/c2051/]pappapc ebook torrent[/url] lisa shaffer smart start ebook
moral of the story rosenstand ebook http://audiobooksplanet.co.uk/Colin-Read/m22320/ ebook craft of software testing [url=http://audiobooksplanet.co.uk/Books-and-Reading/c1117/?page=2]what's an ebook[/url] rose croix free ebook
free new best dating sites http://loveepicentre.com/ sytycd jeanette manrara dating jason
anti motivational posters dating [url=http://loveepicentre.com/map/]p nk and george clooney dating[/url] dads rules for dating
free dating for women in uk [url=http://loveepicentre.com/articles/]is max still dating erin andrews[/url] jeremiah shapero hb dating sites [url=http://loveepicentre.com/user/karmahbaby2002/]karmahbaby2002[/url] dating a drug addict
Post a Comment
<< Home