Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
GeneralRe: Waiting for other threads Pin
Roger Alsing7-May-08 10:08
Roger Alsing7-May-08 10:08 
AnswerRe: Waiting for other threads Pin
User 66587-May-08 9:03
User 66587-May-08 9:03 
AnswerRe: Waiting for other threads Pin
Broken Bokken7-May-08 9:19
Broken Bokken7-May-08 9:19 
GeneralRe: Waiting for other threads Pin
Roger Alsing7-May-08 10:06
Roger Alsing7-May-08 10:06 
GeneralRe: Waiting for other threads Pin
Spacix One7-May-08 10:35
Spacix One7-May-08 10:35 
GeneralRe: Waiting for other threads Pin
Roger Alsing7-May-08 11:12
Roger Alsing7-May-08 11:12 
GeneralRe: Waiting for other threads Pin
GuyThiebaut7-May-08 10:51
professionalGuyThiebaut7-May-08 10:51 
GeneralRe: Waiting for other threads Pin
Spacix One7-May-08 11:01
Spacix One7-May-08 11:01 
QuestionLooking for HELPFUL information on my event log issues Pin
LongRange.Shooter7-May-08 7:25
LongRange.Shooter7-May-08 7:25 
AnswerRe: Looking for HELPFUL information on my event log issues [modified] Pin
DaveyM697-May-08 8:57
professionalDaveyM697-May-08 8:57 
QuestionCannot create an instance of the abstract class or interface 'Excel.Application Pin
Dominic Burford7-May-08 5:14
professionalDominic Burford7-May-08 5:14 
AnswerRe: Cannot create an instance of the abstract class or interface 'Excel.Application Pin
Giorgi Dalakishvili7-May-08 5:21
mentorGiorgi Dalakishvili7-May-08 5:21 
AnswerRe: Cannot create an instance of the abstract class or interface 'Excel.Application Pin
MarkB7777-May-08 13:07
MarkB7777-May-08 13:07 
QuestionRemoting in dot net Pin
ilango gandhi7-May-08 5:07
ilango gandhi7-May-08 5:07 
AnswerRe: Remoting in dot net Pin
led mike7-May-08 5:14
led mike7-May-08 5:14 
AnswerRe: Remoting in dot net Pin
Cranky7-May-08 5:33
Cranky7-May-08 5:33 
AnswerRe: Remoting in dot net Pin
Abhijit Jana7-May-08 5:55
professionalAbhijit Jana7-May-08 5:55 
AnswerRe: Remoting in dot net Pin
leckey7-May-08 6:41
leckey7-May-08 6:41 
QuestionText Ticker Pin
KBou7-May-08 4:59
KBou7-May-08 4:59 
AnswerRe: Text Ticker Pin
Christian Graus7-May-08 12:01
protectorChristian Graus7-May-08 12:01 
QuestionA question on having multiple source log to an eventlog Pin
LongRange.Shooter7-May-08 4:20
LongRange.Shooter7-May-08 4:20 
I have a service that launches multiple threads. Each thread has a unique purpose and thus they are unique sources. I have a successfully created log file named OneSource and I want all of the sources logging events to that log file.

Currently I have each thread initializing and accessing the EventLog with their own instances, the service itself does not do any logging. My first thread that I start successfully initialized and logs to the file but subsequent ones do not. Here is my eventlog initialization logic (some names were changed to protect the innocent Smile | :) :

C#
#region Eventlog initialization

bool creationNeeded = false;

if ( !EventLog.SourceExists( "someSource" ) )
    creationNeeded = true;
else if ( !EventLog.LogNameFromSourceName( "someSource", "." ).Equals( "OneSource" ) )
{
    creationNeeded = true;    // management changed the log name again!
    EventLog.DeleteEventSource( "someSource" );
}
if ( creationNeeded )
{
    EventLog.CreateEventSource( "someSource", "OneSource" );
}

events = new System.Diagnostics.EventLog( "OneSource", ".", "someSource" );
events.WriteEntry( "someSource: Event log successfully started.", EventLogEntryType.Information );

#endregion


FYI: We had management constantly changing their minds on the log file to use so we had to add code to make sure that the old log was deleted before we used the new logfile name and source.

I see the initialization message from sourceOne, but not from sourceTwo or sourceThree. Nor do I see any logged messages from anything but sourceOne. Also...I see Information logged entries from sourceOne, but I never see anything logged where I use an AuditSuccess state for the log event.

Any guidance would be appreciated.
AnswerRe: A question on having multiple source log to an eventlog Pin
led mike7-May-08 4:48
led mike7-May-08 4:48 
GeneralRe: A question on having multiple source log to an eventlog Pin
LongRange.Shooter7-May-08 4:56
LongRange.Shooter7-May-08 4:56 
GeneralRe: A question on having multiple source log to an eventlog Pin
led mike7-May-08 4:59
led mike7-May-08 4:59 
GeneralRe: A question on having multiple source log to an eventlog Pin
Ashfield7-May-08 5:21
Ashfield7-May-08 5:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.