[Mono-list] Nothing happens with mono-service and EventLog.WriteEntry
michael at susens-schurter.com
Mon Feb 12 11:42:03 EST 2007
I created a service in MonoDevelop, compiled it using the 2.0 profile,
and run it using mono-service.
Everything appears to work fine: Service started and stopped messages
show up in my syslog, the process is running, and the lock file exists.
However my service doesn't seem to do anything, and none of my
EventLog.WriteEntry() calls seem to generate any logging information (I
also tried Console.WriteLine()).
How do I even begin to debug this if I can't get any output from it?
I'm using Mono 18.104.22.168 on Debian Sid.
Here are relevant code snippets. I'll post the full source if you think
it would help (its not that big).
Thanks in advance!
/// Class declaration:
class LumberjackService : System.ServiceProcess.ServiceBase
/// Main method:
public static void Main ()
System.ServiceProcess.ServiceBase.Run (new LumberjackService ());
public LumberjackService ()
this.ServiceName = "Lumberjack";
this.CanStop = true;
this.CanPauseAndContinue = false;
this.AutoLog = true;
EventLog.WriteEntry("New Lumberjack Service Created"); // Never seen
protected override void OnStart (string args)
state = LumberjackState.Run;
LumberjackThread = new Thread(new ThreadStart (HarvestLog));
...the thread should output stuff to the event log as well and
eventually die because a file doesn't exist.
More information about the Mono-list