[Mono-dev] Event logging under Mono
Spyros Sakellariadis (MS OPEN TECH)
spyros at microsoft.com
Mon Dec 8 22:38:26 UTC 2014
[Sorry if duplicate. I think I originally sent to wrong alias]
I am trying to implement logging for a small application running under Mono on a Raspberry Pi. Unfortunately I have been unable to create an event log despite following guidance that I have found on the Net, and am wondering if there is best practice on how to do this. FWIW, the steps I have taken are as follows:
1. On the Raspberry Pi, I created /var/lib/mono and /var/lib/mono/eventlog directories, set directory permission on each to 777 per http://lists.ximian.com/pipermail/mono-devel-list/2006-August/019853.html.
2. Ran the following .NET code, based loosely on http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog(v=vs.110).aspx:
static void Main(string args)
Console.WriteLine("Exiting, execute the application a second time to use the source.");
Console.WriteLine("Found the EventLog Source.");
If I run this twice on a Windows 8 machine, the first time it comes back with "CreatedEventSource", the second time it comes back with "Found the EventLog Source", and the Windows Event Log has a new log entitled MyNewLog. However, if I run it on the Raspberry Pi under mono, I get the message "CreatedEventSource" no matter how many times I run it, and no files are created in /var/lib/mono/eventlog.
What am I missing, or what should I try instead?
Microsoft Open Technologies, Inc.
spyros at microsoft.com<mailto:spyros at microsoft.com>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list