Events are being logged to the "Application" log instead of custom log

Hi Pros,

I have a weird problem here. I am logging from my .NET app to a custom log, but unfortunately, the events are redirected to the Application log. I am sure that I am specifying the log name and the source name accurately. I am using some code like the following:

 

1    Hi Pros,
2    
3    I have a weird problem here. I am logging from my .NET app to a custom log, but unfortunately, the events are redirected to the Application log. I am sure that I am specifying the log name and the source name accurately. I am using some code like the following:
4    
5    
6    EventLog ev = new EventLog(myLog);
7     
8                if (EventLog.SourceExists(mySource))
9                {
10                   if (EventLog.LogNameFromSourceName(mySource) != myLog)
11                   {
12                       EventLog.DeleteEventSource(mySource);
13                       EventLog.CreateEventSource(mySource, myLog);
14                   }
15               }
16               else
17               {
18    
19                   EventLog.CreateEventSource(mySource, myLog);
20               }
21               ev.Source = mySource;
22    
23               ev.WriteEntry(message, EventLogEntryType.Error);
 
HELPPPPP!!!
The best glimpse of heaven is on the way into hell ;)
yousef.omar@gmail.com
http://nonstopbiztalk.blogspot.com
0
yousef
2/6/2008 11:49:24 AM
asp.net.getting-started 91979 articles. 4 followers. Follow

1 Replies
990 Views

Similar Articles

[PageSpeed] 20
Get it on Google Play
Get it on Apple App Store

Hi,

If we do not explicitly set the Log property, the event log defaults to the Application log. So please try to set the Log property in your case, such as EventLog.Log = EventLogName

For more information, see http://msdn2.microsoft.com/en-us/library/system.diagnostics.eventlog.aspx

 

If this doesn’t help you, please feel free to let me know.


I hope this helps.


Thomas Sun
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
Thomas
2/11/2008 3:52:21 AM
Reply:

Similar Artilces:

"data only" "log only" data and log"
i altered the db to include 1 gb. however the fragment was created "data and log". what should have i done to create a 'data only' fragment? melanie wrote: > i altered the db to include 1 gb. > however the fragment was created "data and log". > > what should have i done to create a 'data only' fragment? I believe I'm correct in saying that if your database has data and log on separate devices the alter database command will assume you're adding to "data" unless you specify otherwise by using the "log on&q...

Getting "" Instead of logged-in "UserName" From Login Control
I can't seem to access UserName from my "Login1" control.  Here's what I did: In Login.aspx.cs:      protected void Login1_LoggedIn(object sender, EventArgs e)     {         Session["User"] = Login1.UserName;     }  In Global.asax:      void Session_Start(object sender, EventArgs e)     {         string d = "Instantiating Variable Value";       ...

why logs in ZAP when I say "no logs" ?
latest Zone Alarm Pro running on my laptop with XP Pro Alerts & Logs, for all 3 items "OFF" is set (Alert Events Shown) (Event Logging) (Program Logging) my \Internet Logs\ is filled with ZALog.....txt files also, what are the xDBxxx.tmp files? (ie. xDB5.tmp, xDB328.tmp) - can I safely delete these? mgwmp <p.zie@cnn.com> wrote: > latest Zone Alarm Pro running on my laptop with XP Pro > > Alerts & Logs, for all 3 items "OFF" is set > (Alert Events Shown) > (Event Logging) > (Program Logging) > > my \Internet Logs\ ...

How to implement logging with "using" instead of "try/catch"
I'm rewriting a page and wanted to rework some of the data access portions. Right now there are try/catch blocks around the code. I know how to use the using statement instead however, in the catch portion we have a log4net control recording errors. How would I implement in the using statement. Simply wrapping the entire existing try/catch blocks in a using statement seems like it would just generate even more try/catches. Good point. AFAIK there is no way. However, the intention of these constructs are a little different; using only has a subset of what try/catch/finally can do, w...

Bugzilla "Log in" fails to log in user
I've recently installed Bugzilla 3.6 but had the same problem with 3.4 On the main page, If I press the 'Log In' link, two fields show up. The first field is for the 'login' (id I assume) and the second is for the 'password'. I type in my information and press the "Log in" button. The screen blinks at me and then returns to the main page without having logged me in. If I click the big "File a Bug" button, then it takes me to a full page 'log in' screen, which does allow me to log in. I've tried using the 'quick' l...

Error : "E. No offline transaction log file found, Online transaction log starts at offset XXXXXXXX"
I am getting a mobilink sync problem. Please give me your valuable suggestions everything is fine after reading the subscription, the ml client gives the following error. None reported in the server window I. Begin synchronizing for "xx" for user id "xx" E. No offline transaction log file found, online transaction log starts at offset at "xxxxxx" E. upload aborted at "xxxxxx" E. download aborted Thanks for your help DIL "DIL" <skumar@ameren.com> wrote in news:OQ4zcmZvCHA.155@forums.sybase.com: >...

Cannot open transaction log file Can't use log file "JUDIC.LOG" since its shorter than expected
This is a multi-part message in MIME format. ---=_forums-1-dub4ca971d0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Dear Sybase support Team, I tried to start a service in Sybase but all I was getting was =93Cannot open transaction log file Can't use log file "JUDIC.LOG" since its shorter than expected=94 . Tried to google out for some solutions , but all I was getting , were Sybase errors with no solutions. I kindly seek your help on what might have been the cause and the solution to the problem. Your...

Negative "free kbytes" and log "free kbytes" not applicable?
Just upgraded two very large servers (each with 60+ databases, one with largest at 13gb, the other with largest at 37gb). (Environment is HP-UX 11 - 500mb ram, kajillions of gb of disk space!) Upgrade seemed to go well despite the need for alot of page flipping in the Install manual but as usual, all questions were answered somewhere in the doc (thanks, Sybase!) However, now the new sp_helpdb reports negative values for the free space of on many of the device fragments for some databases. Also, all the log fragments for all databases now report "not applicable" in the f...

Issue "Persona logs out at random then logs in again" seems to have been resolved
https://github.com/mozilla/browserid/issues/2560 This had been a major problem in the Drupal module until I implemented the workaround. I just noticed that my workaround was causing problems after a file had been downloaded from a page, so I tried removing the workaround and it seems the problem no longer exists. I will remove the workaround from the Drupal module. The workaround should be removed from anywhere else it is in use. ...

Transaction Log full even when "trunc log on chkpt" on
I'm pretty new to Sybase and am having problem with my transaction log. Every time I try and execute a statement which inserts over a 1000 lines into a table it won't work as it says my transaction log is full. But I dump my transaction log before I do these inserts. Also "trunc log on chkpt" is on. I don't know whether it is the size of my transaction log is my problem or if its something else. Any help would be great. Heres some more info on my transaction log and my database if it helps: 1> sp_helpsegment logsegment 2> go segment name stat...

Problem with "Timeout expired." as more users start logging into the web application
Hi All,       I need some help on developing a plan as to what to look for in this situation. After 100+ or so users start using the application a few pages(always the same pages too) start throwing the exception message, "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."(see inner exception below). The page and the stored procedure are relatively straight forward, an SP that creates a dataset and displays to a grid. We are using .NET 2.0 & SQL SERVER 2000 (not web farm). I inc...

"not logged in"
Good morning, Running BM38, XPPro with NWClient 4.91 SP2 on workstations, clntrust.exe dated 12/19/2003. This has been an issue for quite some time, thru a number of versions (BM35, older clntrusts, etc.). Newly built / rebuilt machines are configured, first time a user logs on, launches browser, gets "You are not logged in!" error from BM server. User *is* logged in. Hitting dwntrust/clntrust doesn't seem to matter. User just has to wait a couple of minutes, maybe try to force a reload, and after a bit, everything works fine. Doesn't seem to matter if browser is...

Re: "cannot write to log file: unable to open log file"
in the meantime i opened a support call with novell, where i got the information this would be a well known problem regarding a conflict in writing to log.nsf. there are two ways to handle this: 1. install remote loader on a system with notes client and communicating with the domino-server through that client (as in installation guide). 2. reconfiguring domino-server to use another notes.ini we did neither want to set up another system for every of our 60 notes-drivers nor move away from domino-standard that far. our solution is to forbid ndriver.id to write anything to the log...

Logging log
Hi! I try to accomplish task described in http://forums.novell.com/novell-product-support-forums/zenworks/configuration-management/zcm-server-install/422609-mixed-login.html?pagenumber= and wonder I don't know how to keep log of logging? I mean, does ZCM is capable to keep logging log? As Altiris NS does? More thanks, Alar. -- NovAlf ------------------------------------------------------------------------ You look like you want to log in to your zone as a user from either a eDIR or AD. And yes this is possible, it will search both Directories. http://www.theurbanp...

Web resources about - Events are being logged to the "Application" log instead of custom log - asp.net.getting-started

Resources last updated: 2/9/2016 8:23:37 PM