[Mono-dev] [PATCH] New eventlog implementation

Atsushi Eno atsushi at ximian.com
Tue Aug 15 08:15:12 EDT 2006


RunningOnLinux looks extraneous. It could just check the path validity
and existence of "/var/blah" (besides it is not a precise name,
as well as UnixEventLog which is very likely be used on Windows).

As for other comments I've already wrote to Gert in #mono.

In response to Gert's request, my final code review is done above.

My impression is, the patch is not worthy enough of being checked
in, as it does almost nothing.

The purpose of the patch is to support Windows Event Log on windows.
It is good, but the patch simply does not work. The code could be
checked in later, when it became useful enough to read logs.

(If the purpose is just to support registry, it includes too many
unnecessary changes. IF I took over the entire event log stuff,
I'd just revert his changes to whatever I had.)

Having said that, I don't object if someone approves the patch
i.e. I don't want to spend my time anymore on this tiny demand
on this registry based implementation.

Atsushi Eno

Gert Driesen wrote:
> Hi,
> 
> I've finished implementing the eventlog changes and incorporated
> feedback by Atushi Eno (let me know if there's anything message).
> 
> We now have the following environment variables for configuring the
> eventlog subsystem: 
> 
> - MONO_EVENTLOG_TYPE for setting the implementation type.
> 
>                 Possible value are:
>         
>                 * win32 : read/write entries using the native win32
>                 eventlog
>                 * local : read/write entries as files to a local
>                 directory
>                 * null  : silently ignore all entries
> 
>                 The default is "null", meaning entries will be silently
>                 ignored.
> 
>                 If the implementation is set to "local" and
>                 MONO_EVENTLOG_PATH
>                 is not set, then the following directory will be used
>                 for storing eventlog entries:
> 
>                 * windows : %APPDATA%\mono\eventlog
>                 * unix    : /var/lib/mono/eventlog
> 
>                 On unix, the directory permission for indivual eventlog
>                 log directories is set to 777 (with +t bit) allowing
>                 everyone to read and write eventlog entries while only
>                 allowing entries to be deleted by the user(s) that
>                 created them.
> 
> - MONO_EVENTLOG_PATH for setting the local file path.
> 
>                 If set, and MONO_EVENTLOG_IMPL is not set then the local
>                 file implementation is used.
> 
> - MONO_REGISTRY_MACHINE for setting the directory to use for storing the
> machine-level registry hives.
> 
>                 If not set, then the machine-level registry hives are
>                 stored in directory .mono/registry relative to the
>                 user's home directory.
> 
>                 This applies to HKEY_LOCAL_MACHINE, HKEY_CURRENT_CONFIG,
>                 HKEY_CLASSES_ROOT, HKEY_DYN_DATA, HKEY_PERFORMANCE_DATA
>                 and HKEY_USERS.
> 
> For this last environment variable, I'll supply a separate patch once my
> other registry changes have been approved (to avoid a patch nightmare).
> 
> A simple test application for the eventlog subsystem (by courtesy of
> Atsushi Eno):
> 
> using System;
> using System.Diagnostics;
> 
> public class Test
> {
>   public static void Main ()
>   {
>     if (!EventLog.Exists ("enolog")) {
>       EventLog.CreateEventSource ("enologue", "enolog");
>     }
> 
>     EventLog log = new EventLog ("enolog", ".", "enologue");
>     foreach (EventLogEntry e in log.Entries)
>       Console.WriteLine (e.Message);
>     log.WriteEntry ("My test message.");
>   }
> }
> 
> Note: set the MONO_EVENTLOG_TYPE environment variable to "local" if you
> want the entries to be persisted to the local file store.
> 
> Let me know if there's anything that you want me to change, or if it's
> ok to commit as such.
> 
> I'll update the man page once my patch is approved (but before I commit
> it).
> 
> Best regards,
> 
> Gert




More information about the Mono-devel-list mailing list