Hi

Did You set MONO_EVENTLOG_TYPE? win32|local|null;

cheers

mel

On 20141208 23:38 , Spyros Sakellariadis (MS OPEN TECH) wrote:

[Sorry if duplicate. I think I originally sent to wrong alias]

Hi --

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 <http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog%28v=vs.110%29.aspx>:

using System;

using System.Text;

using System.Diagnostics;

namespace Logging

{

    class Program

    {

        static void Main(string[] args)

        {

            if (!EventLog.SourceExists("MySource"))

            {

EventLog.CreateEventSource("MySource", "MyNewLog");

Console.WriteLine("CreatedEventSource");

Console.WriteLine("Exiting, execute the application a second time to use the source.");

                return;

            }

            else

Console.WriteLine("Found the EventLog Source.");

            return;

        }

    }

}

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?

Spyros Sakellariadis

Microsoft Open Technologies, Inc.

spy...@microsoft.com <mailto:spy...@microsoft.com>



_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to