473,387 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Why can't the source for a log have the service's name?!

I noticed that then i execute the
following code everything works fine.

if (!EventLog.SourceExists(source))
EventLog.CreateEventSource(source, LOG_NAME);
EventLog eventLog = new EventLog(LOG_NAME);
eventLog.Source = source;
eventLog.WriteEntry(message, type);

But, to my astonishment, when i specify
the source to be of the same name as the
service (not LOG_NAME, but the service's
name), i get no logging. What's up here?!

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
Sep 11 '08 #1
3 925
>I noticed that then i execute the
following code everything works fine.

if (!EventLog.SourceExists(source))
EventLog.CreateEventSource(source, LOG_NAME);
EventLog eventLog = new EventLog(LOG_NAME);
eventLog.Source = source;
eventLog.WriteEntry(message, type);

But, to my astonishment, when i specify
the source to be of the same name as the
service (not LOG_NAME, but the service's
name), i get no logging. What's up here?!
In fact, when i changed the name of the
service i still got the behavior, so the
only string that is equal to the name of
the source i'm trying to log is the
namespace name... I believe i'm getting
slightly retarded.

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
Sep 11 '08 #2
On Sep 11, 1:45*am, "K Viltersten" <t...@viltersten.comwrote:
I noticed that then i execute the
following code everything works fine.

if (!EventLog.SourceExists(source))
* EventLog.CreateEventSource(source, LOG_NAME);
EventLog eventLog = new EventLog(LOG_NAME);
eventLog.Source = source;
eventLog.WriteEntry(message, type);

But, to my astonishment, when i specify
the source to be of the same name as the
service (not LOG_NAME, but the service's
name), i get no logging. What's up here?!

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
I do not understand your question, do you get any entry at all in the
log?
If you are running Vista check the custom logs folder
Sep 11 '08 #3
>I noticed that then i execute the
>following code everything works fine.

if (!EventLog.SourceExists(source))
EventLog.CreateEventSource(source, LOG_NAME);
EventLog eventLog = new EventLog(LOG_NAME);
eventLog.Source = source;
eventLog.WriteEntry(message, type);

But, to my astonishment, when i specify
the source to be of the same name as the
service (not LOG_NAME, but the service's
name), i get no logging. What's up here?!

I do not understand your question, do you get
any entry at all in the log?
I don't blame you. It's a very strange thing.
Apparently, i made some registrations within
the registry that locked logging to the old
log. When i tried to log to the new one, i got
nothing. I got the hint to restart the computer
(or do some heavy duty registry digging) and it
"solved" the problem.

It's ennoying because i don't know what might
have caused it... Nevermind, for now, though.
Thanks for trying! :)

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
Sep 13 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Werner Merkl | last post by:
Hi, Python is really great, for small to big programs. For my colleagues and some circumstances I sometimes need to "compile" a script using py2exe. Cause I use Windows, I like to use the...
0
by: Monica Ferrero | last post by:
Hi! I'm not sure if this is the most adequate mySQL list for this post. If not, please indicat me which one I should use... I'm using Tomcat 4.1.24 with Apache 2 and MySQL 4.0.13. I have the...
5
by: Don Sealer | last post by:
I'd like to have a name show up on a report. I have a report based on a query. When the report is activated it asks for a name. I input the name and the query sorts the data and displays it in...
2
by: Steve Harclerode | last post by:
Hi all, I've been doing web service development for a year, with a break for the last few months. What I remember is how easy it is to reference a web service using Visual Studio. So today, I...
6
by: Dean R. Henderson | last post by:
I have a DTS Package I am able to execute successfully from a Windows Form application, but I cannot get this to work from an ASP.NET Web Service, although the Web Service impersonates the same...
1
by: MAL | last post by:
Hello, I am writing a service program that writes to a custom EventLog. I would like the two classes used in the service to write messages to the same log ideally using a different Source name...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
6
by: JeffDotNet | last post by:
Writing to a registered source in the Application event log I have an asp.net framework 2.0 app that I created on a winxp machine and now I am deploying it to IIS6 on a win server2003 machine. ...
8
lifeisgreat20009
by: lifeisgreat20009 | last post by:
What might be the possible cause ? I have created a website using struts framework, jsp In my transaction page the money is not getting transferred.. When I hit the submit button in my...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.