diff options
author | Gert Driesen <drieseng@users.sourceforge.net> | 2006-08-20 15:54:06 +0400 |
---|---|---|
committer | Gert Driesen <drieseng@users.sourceforge.net> | 2006-08-20 15:54:06 +0400 |
commit | bc28d0226bc08ced5a387ea4fd5cc6ac2a72763d (patch) | |
tree | ae4f1ebe5f2515e6d9f52a5d92f905579769c432 /mcs/class/System/System.Diagnostics/EventLogEntry.cs | |
parent | 795386f65bc0ce027ec2fb8f8fb5e695c06c5cac (diff) |
* System.dll.sources: Added Win32EventLog.cs.
* EventLogEntry.cs: Added InstanceId property (2.0 only). Moved
Obsolete attribute to correct property.
* EventSourceCreationData.cs: Updated copyright. For internal ctor,
set log name to "Application" if value is null or zero-length string.
* EventLogImpl.cs: EventImpl now acts as base class for event log
implemenations.
* NullEventLog.cs: Modified to implement new abstract methods of base
class. Removed factory class.
* EventLog.cs: EventLog implementation that delegates just about
everything to individual eventlog providers. To specify the event log
implementation to use, the MONO_EVENTLOG_TYPE environment variable can
be used. Possible values are:
- win32 : read/write entries using the native win32 eventlog
- local[:path] : read/write entries as files to a local directory
- null : silently ignore all entries
The default is "null" on unix (and versions of Windows before NT,
meaning Windows 98, ...), and "win32" on Windows NT (and higher).
When "the local" implementation is used, the directory in which to
store the event logs, event sources and entries can be specified as
part of MONO_EVENTLOG_TYPE environment variable using the syntax
"local:<path>" (eg. local:/home/myuser/mono/eventlog).
* LocalFileEventLog.cs: Event log implementation which uses a local
file store. The directory to use for persistence can be specified
as part of the MONO_EVENTLOG_TYPE environment variable (see above).
If that directory is not explicitly 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 individual eventlog log
directories will be 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.
Format of log files was modified to allow it contain all necessary
information for an event log entry.
* Win32EventLog.cs: Event log implementation for Windows NT and
higher which uses the Win32 native event log for reading/writing
eventlog entries, and which uses the registry to store event log and
event source registration information.
* EventLogEntryCollection.cs: Delegate implementation to event log
implementation. Use lazy init for enumerating entries. Cache current
item in 2.0 profile.
* EventLogTest.cs: Enable tests. On 2.0 profile, set MONO_EVENTLOG_TYPE
environment variable to force local file implementation to be used for
unit tests. This avoids permission issues for the unit tests, and
allows us to clean up the files/directory that are created during the
test run. Skip tests that cannot pass when the null implementation is
active (on 1.0 profile). Added tests for all WriteEntry and WriteEvent
(2.0 only) overloads, Clear, Entries, Exists and LogNameFromSourceName.
svn path=/trunk/mcs/; revision=64088
Diffstat (limited to 'mcs/class/System/System.Diagnostics/EventLogEntry.cs')
-rw-r--r-- | mcs/class/System/System.Diagnostics/EventLogEntry.cs | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/mcs/class/System/System.Diagnostics/EventLogEntry.cs b/mcs/class/System/System.Diagnostics/EventLogEntry.cs index b233252824d..136cd01fdbd 100644 --- a/mcs/class/System/System.Diagnostics/EventLogEntry.cs +++ b/mcs/class/System/System.Diagnostics/EventLogEntry.cs @@ -31,6 +31,9 @@ // using System.ComponentModel; +#if NET_2_0 +using System.Runtime.InteropServices; +#endif using System.Runtime.Serialization; using System.Security.Permissions; @@ -56,12 +59,15 @@ namespace System.Diagnostics private DateTime timeGenerated; private DateTime timeWritten; private string userName; +#if NET_2_0 + private long instanceId; +#endif internal EventLogEntry (string category, short categoryNumber, int index, - int eventID, string message, string source, - string userName, string machineName, EventLogEntryType entryType, - DateTime timeGenerated, DateTime timeWritten, byte[] data, - string[] replacementStrings) + int eventID, string source, string message, string userName, + string machineName, EventLogEntryType entryType, + DateTime timeGenerated, DateTime timeWritten, byte[] data, + string[] replacementStrings, long instanceId) { this.category = category; this.categoryNumber = categoryNumber; @@ -76,6 +82,9 @@ namespace System.Diagnostics this.timeGenerated = timeGenerated; this.timeWritten = timeWritten; this.userName = userName; +#if NET_2_0 + this.instanceId = instanceId; +#endif } [MonoTODO] @@ -98,14 +107,14 @@ namespace System.Diagnostics get { return data; } } -#if NET_2_0 - [Obsolete ("Use InstanceId")] -#endif [MonitoringDescription ("The type of this event entry.")] public EventLogEntryType EntryType { get { return entryType; } } +#if NET_2_0 + [Obsolete ("Use InstanceId")] +#endif [MonitoringDescription ("An ID number for this event entry.")] public int EventID { get { return eventID; } @@ -116,6 +125,13 @@ namespace System.Diagnostics get { return index; } } +#if NET_2_0 + [ComVisible (false)] + public long InstanceId { + get { return instanceId; } + } +#endif + [MonitoringDescription ("The Computer on which this event entry occured.")] public string MachineName { get { return machineName; } |