- Event Logging (Windows Installer)
- Event Log Logger Класс
- Определение
- Конструкторы
- Свойства
- Методы
- Методы расширения
- Windows Event Logs — Event Log FAQ
- What is Windows event log?
- How to view event logs?
- What is Windows Event Log Service?
- What are Windows event log files?
- What is Windows Application event log?
- What is Windows System event log?
- Event Log Класс
- Определение
- Примеры
- Комментарии
- Конструкторы
- Свойства
- Методы
- События
Event Logging (Windows Installer)
Windows Events provides a standard, centralized way for applications (and the operating system) to record important software and hardware events. The event-logging service stores events from various sources in a single collection called an event log. Prior to WindowsВ Vista, you would use either Event Tracing for Windows (ETW) or Event Logging to log events. WindowsВ Vista introduced a new eventing model that unifies both ETW and the Windows Event Log API.
The installer also writes entries into the event log. These record events such as following:
- Success or failure of the installation; removal or repair of a product.
- Errors that occur during product configuration.
- Detection of corrupted configuration data.
If a large amount of information is written, the Event Log file can become full and the installer displays the message, «The Application log file is full.»
The installer may write the following entries in the event log. All event log messages have a unique event ID. All general errors authored in the Error table that are returned for an installation that fails are logged in the Application Event Log with a message ID equal to the Error + 10,000. For example, the error number in the Error table for an installation completed successfully is 1707. The successful installation is logged in the Application Event Log with a message ID of 11707 (1707 + 10,000).
For information about how to enable verbose logging on a user’s computer when troubleshooting deployment, see Windows Installer Best Practices.
Event Log Logger Класс
Определение
This type is obsolete and will be removed in a future version. The recommended alternative is using EventLogLoggerProvider to construct loggers.
Средство ведения журнала, записывающее сообщения в журнал событий Windows. A logger that writes messages to Windows Event Log.
Конструкторы
Инициализирует новый экземпляр класса EventLogLogger. Initializes a new instance of the EventLogLogger class.
Инициализирует новый экземпляр класса EventLogLogger. Initializes a new instance of the EventLogLogger class.
Инициализирует новый экземпляр класса EventLogLogger. Initializes a new instance of the EventLogLogger class.
Свойства
Методы
Начало области логической операции. Begins a logical operation scope.
Определяет, равен ли указанный объект текущему объекту. Determines whether the specified object is equal to the current object.
(Унаследовано от Object)
Служит хэш-функцией по умолчанию. Serves as the default hash function.
(Унаследовано от Object)
Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.
(Унаследовано от Object)
Проверяет, включен ли указанный уровень logLevel . Checks if the given logLevel is enabled.
Делает запись журнала. Writes a log entry.
Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.
(Унаследовано от Object)
Возвращает строку, представляющую текущий объект. Returns a string that represents the current object.
(Унаследовано от Object)
Методы расширения
Форматирует сообщение и создает область. Formats the message and creates a scope.
Форматирует и записывает сообщение журнала на указанном уровне журнала. Formats and writes a log message at the specified log level.
Форматирует и записывает сообщение журнала на указанном уровне журнала. Formats and writes a log message at the specified log level.
Форматирует и записывает сообщение журнала на указанном уровне журнала. Formats and writes a log message at the specified log level.
Форматирует и записывает сообщение журнала на указанном уровне журнала. Formats and writes a log message at the specified log level.
Форматирует и записывает критическое сообщение журнала. Formats and writes a critical log message.
Форматирует и записывает критическое сообщение журнала. Formats and writes a critical log message.
Форматирует и записывает критическое сообщение журнала. Formats and writes a critical log message.
Форматирует и записывает критическое сообщение журнала. Formats and writes a critical log message.
Форматирует и записывает в журнал сообщение отладки. Formats and writes a debug log message.
Форматирует и записывает в журнал сообщение отладки. Formats and writes a debug log message.
Форматирует и записывает в журнал сообщение отладки. Formats and writes a debug log message.
Форматирует и записывает в журнал сообщение отладки. Formats and writes a debug log message.
Форматирует и записывает в журнал сообщение об ошибке. Formats and writes an error log message.
Форматирует и записывает в журнал сообщение об ошибке. Formats and writes an error log message.
Форматирует и записывает в журнал сообщение об ошибке. Formats and writes an error log message.
Форматирует и записывает в журнал сообщение об ошибке. Formats and writes an error log message.
Форматирует и записывает в журнал информационное сообщение. Formats and writes an informational log message.
Форматирует и записывает в журнал информационное сообщение. Formats and writes an informational log message.
Форматирует и записывает в журнал информационное сообщение. Formats and writes an informational log message.
Форматирует и записывает в журнал информационное сообщение. Formats and writes an informational log message.
Форматирует и записывает в журнал сообщение трассировки. Formats and writes a trace log message.
Форматирует и записывает в журнал сообщение трассировки. Formats and writes a trace log message.
Форматирует и записывает в журнал сообщение трассировки. Formats and writes a trace log message.
Форматирует и записывает в журнал сообщение трассировки. Formats and writes a trace log message.
Форматирует и записывает в журнал сообщение с предупреждением. Formats and writes a warning log message.
Форматирует и записывает в журнал сообщение с предупреждением. Formats and writes a warning log message.
Форматирует и записывает в журнал сообщение с предупреждением. Formats and writes a warning log message.
Форматирует и записывает в журнал сообщение с предупреждением. Formats and writes a warning log message.
Windows Event Logs — Event Log FAQ
What is Windows event log?
Event logs are special files that record significant events on your computer, such as when a user logs on to the computer or when a program encounters an error. Whenever these types of events occur, Windows records the event in an event log. Users might find the details in event logs helpful when troubleshooting problems with Windows and other programs.
Unlike UNIX syslog, Microsoft event log is not a text file and it is impossible to view it with simple text editors. Microsoft Windows event log is a binary file that consists of special records – Windows events.
Microsoft Windows runs Event Log Service to manage event logs, configure event publishing, and perform operations on the logs. Windows Event Log service exposes a special API, which allows applications to maintain and manage event logs.
Windows event logging was introduced in Windows NT operating system (version 3.1) in 1993. This Windows edition came with three Windows logs: Application event log, System event log and Security event log. Modern versions of Windows come with more than a hundred of Windows eventlogs, and third party applications can create and integrate into Windows logging their own event logs.
How to view event logs?
You can view eventlogs using Event Viewer (comes with Windows operating system) or third-party Windows event viewers. We recommend using our Event Log Explorer software – it provides a lot of advanced features for event log management.
What is Windows Event Log Service?
Windows Event Log Service is a Windows service that manages events and event logs. It supports logging events, querying events, subscribing to events, archiving event logs, and managing event metadata. It helps to display events in both XML and plain text format. This service is enabled and starts automatically by default. You should not stop or disable this service. Stopping Windows Event Log service may compromise security and reliability of the system.
What are Windows event log files?
Windows Event Log Service lets users to save (backup) event logs to files. Windows NT, 2000 and XP/2003 save event logs to EVT format. Windows Vista/2008 and better save logs to EVTX format. Having backup event files are essential for incident investigation.
Windows event logs are also files, but they are commonly locked by Windows (Event Log Service) and it is impossible to open these files on «live» system. But if the computer is started from another disk or the system drive from the analyzed machine is connected to another computer, you can read event logs as files. The default location of event logs on Vista/2008 and better is «C:\Windows\System32\winevt\Logs\». Windows Event Viewer allows you to open event file as follows:
Click Open Saved Log in Actions pane of Event Viewer.
Select your event log file and it will appear in Windows Event Viewer as a log.
Our Event Log Explorer software also works with event files and does it even better than Event Viewer, e.g. it lets you read even damaged event files.
What is Windows Application event log?
The Application log contains events logged by applications or programs. For example, a database program might record a file error in the application log. Program developers decide which events should be logged. E.g. Microsoft SQL Server logs details about important events linked with SQL server, e.g. «out of memory», «backup failure» etc. One application log commonly contains events logged from different sources (applications), so it is incorrect to rely solely on event ID when analyzing the Application log. You should always rely on event ID along with event source. Some applications, such as Internet Explorer, Power Shell create own event log instead of using Windows application event log. Such logs look exactly like standard Windows event logs and Event Viewer (as well as Event Log Explorer) can read these event logs. Application logs are commonly useful for application support teams.
What is Windows System event log?
The System log contains events logged by Windows system components. For example, the failure of a driver or other system component to load during startup is recorded in the system log. The event types logged by system components are predetermined by Windows. Similarly to Application log, System event log lists events from different sources (system components) so you should not rely only on event ID when analyzing System log, instead you should rely on event ID along with event source. System logs are essential for system administrators and technicians.
Event Log Класс
Определение
Обеспечивает взаимодействие с журналами событий Windows. Provides interaction with Windows event logs.
Примеры
В следующем примере создается источник события MySource , если он еще не существует, и записывается запись в журнал событий MyNewLog . The following example creates the event source MySource if it doesn’t already exist, and writes an entry to the event log MyNewLog .
Начиная с Windows Vista, это приложение необходимо запускать от имени администратора. Starting with Windows Vista, you must run this application as an administrator.
Комментарии
EventLog позволяет осуществлять доступ или настраивать журналы событий Windows, которые записывают сведения о важных событиях программного обеспечения или оборудования. EventLog lets you access or customize Windows event logs, which record information about important software or hardware events. С помощью EventLog можно выполнять чтение из существующих журналов, записывать записи в журналы, создавать или удалять источники событий, удалять журналы и отвечать на записи журнала. Using EventLog, you can read from existing logs, write entries to logs, create or delete event sources, delete logs, and respond to log entries. При создании источника событий можно также создать новые журналы. You can also create new logs when creating an event source.
Этот тип реализует интерфейс IDisposable. This type implements the IDisposable interface. По окончании использования выдаленную ему память следует прямо или косвенно освободить. When you have finished using the type, you should dispose of it either directly or indirectly. Чтобы сделать это прямо, вызовите его метод Dispose в блоке try / catch . To dispose of the type directly, call its Dispose method in a try / catch block. Чтобы сделать это косвенно, используйте языковые конструкции, такие как using (в C#) или Using (в Visual Basic). To dispose of it indirectly, use a language construct such as using (in C#) or Using (in Visual Basic). Дополнительные сведения см. в разделе «Использование объекта, реализующего IDisposable» в статье об интерфейсе IDisposable. For more information, see the «Using an Object that Implements IDisposable» section in the IDisposable interface topic.
Кроме предоставления доступа к отдельным журналам событий и их записям, EventLog класс позволяет получить доступ к коллекции всех журналов событий. In addition to providing access to individual event logs and their entries, the EventLog class lets you access the collection of all event logs. Члены класса можно использовать static EventLog для удаления журналов, получения списков журналов, создания или удаления источника, а также для определения того, содержит ли компьютер определенный источник. You can use the static members of EventLog to delete logs, get log lists, create or delete a source, or determine if a computer already contains a particular source.
Существует три журнала событий по умолчанию: приложение, система и безопасность. There are three default event logs: Application, System, and Security. Журнал безопасности доступен только для чтения. A Security log is read-only. Другие приложения и службы, которые вы устанавливаете, например Active Directory, могут иметь дополнительные журналы событий. Other applications and services you install, such as Active Directory, might have additional event logs.
При использовании класса необходимо учитывать вопросы безопасности EventLog . There are security considerations when using the EventLog class. EventLog требуются EventLogPermission разрешения для определенных действий в платформа .NET Framework 2,0 и более поздних версий или полное доверие в платформа .NET Framework 1,0 и 1,1. EventLog requires EventLogPermission permissions for specific actions in the .NET Framework 2.0 and later versions, or full trust in the .NET Framework 1.0 and 1.1. EventLogPermissionНе рекомендуется предоставлять частично доверенному коду. We recommend that EventLogPermission not be granted to partially trusted code. Никогда не следует передавать объекты журнала событий, включая EventLogEntryCollection и EventLogEntry , в менее надежный код. You should never pass any event log object, including EventLogEntryCollection and EventLogEntry objects, to less trusted code. Например, создание EventLog объекта, запись записи, а затем передача EventLog объекта в частично доверенный код может привести к возникновению проблемы безопасности, поскольку возможность чтения и записи в журнал событий позволяет коду выполнять такие действия, как выдача сообщений журнала событий в имени другого приложения. For example, creating an EventLog object, writing an entry, and then passing the EventLog object to partially trusted code can create a security issue, because the ability to read and write to the event log allows code to perform actions such as issuing event log messages in the name of another application.
Начиная с Windows Vista, Управление учетными записями пользователей (UAC) определяет учетные данные пользователя. Starting with Windows Vista, User Account Control (UAC) determines the credentials of a user. Члену встроенной группы «Администраторы» присваивается два маркера доступа на время выполнения: маркер доступа обычного пользователя и маркер доступа администратора. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. По умолчанию назначена роль обычного пользователя. By default, you are in the standard user role. Чтобы выполнить код, обращающийся к журналу безопасности, необходимо сначала повысить свои учетные данные от обычного пользователя до администратора. To run the code that accesses the Security log, you must first elevate your credentials from standard user to administrator. Это можно сделать при запуске приложения, открыв контекстное меню для приложения (если вы используете мышь, щелкните правой кнопкой мыши значок приложения) и укажите, что требуется запустить от имени администратора. You can do this when you start an application by opening the shortcut menu for the application (if you’re using a mouse, right-click the application icon) and indicating that you want to run as an administrator.
Можно использовать EventLog для создания пользовательских журналов событий, которые можно просмотреть с помощью Просмотр событий сервера. You can use EventLog to create custom event logs that you can view through the server’s Event Viewer. Используйте RegisterDisplayName метод, чтобы отобразить локализованное имя для журнала событий в Просмотр событий. Use the RegisterDisplayName method to display a localized name for your event log in the Event Viewer. Используйте ModifyOverflowPolicy метод, чтобы настроить поведение журнала событий при достижении максимального размера журнала. Use the ModifyOverflowPolicy method to configure the behavior of your event log when it reaches its maximum log size.
Для чтения из журнала событий укажите имя журнала ( Log свойство) и имя компьютера сервера ( MachineName свойство для журнала событий. To read from an event log, specify the log name (Log property) and server computer name (MachineName property for the event log. Если не указать имя компьютера сервера, предполагается, что используется локальный компьютер «.». If you don’t specify the server computer name, the local computer, «.», is assumed. Нет необходимости указывать источник события ( Source свойство), поскольку источник необходим только для записи в журналы. It’s not necessary to specify the event source (Source property), because a source is required only for writing to logs. EntriesСвойство автоматически заполняется списком записей журнала событий. The Entries property is automatically populated with the event log’s list of entries.
Для записи в журнал событий укажите или создайте источник события ( Source свойство). To write to an event log, specify or create an event source (Source property). Для создания нового источника событий необходимо иметь учетные данные администратора на компьютере. You must have administrative credentials on the computer to create a new event source. Источник событий регистрирует приложение в журнале событий в качестве допустимого источника записей. The event source registers your application with the event log as a valid source of entries. Можно использовать источник событий для записи только в один журнал за раз. You can use the event source to write to only one log at a time. SourceСвойство может быть любой случайной строкой, но имя должно отличаться от других источников на компьютере. The Source property can be any random string, but the name must be distinct from other sources on the computer. Источником события обычно является имя приложения или другая идентифицирующая строка. The event source is typically the name of the application or another identifying string. При попытке создать повторяющееся Source значение возникает исключение. Trying to create a duplicate Source value throws an exception. Однако один журнал событий может быть связан с несколькими источниками. However, a single event log can be associated with multiple sources.
Если источник событий для журнала событий, связанного с EventLog экземпляром, не существует, создается новый источник событий. If the event source for the event log associated with the EventLog instance doesn’t exist, a new event source is created. Чтобы создать источник событий в Windows Vista и более поздних версиях или Windows Server 2003, необходимо иметь учетные данные администратора. To create an event source in Windows Vista and later or Windows Server 2003, you must have administrative credentials.
Это требование связано с тем, что необходимо выполнить поиск всех журналов событий, включая журналы безопасности, чтобы определить, является ли источник события уникальным. This requirement is because all event logs, including Security logs, must be searched to determine whether the event source is unique. Начиная с Windows Vista, пользователи не имеют разрешения на доступ к журналу безопасности; Поэтому SecurityException создается исключение. Starting with Windows Vista, users do not have permission to access the Security log; therefore, a SecurityException is thrown.
Для создания или удаления источника события требуется синхронизация базового кода с помощью именованного мьютекса. Creating or deleting an event source requires synchronization of the underlying code by using a named mutex. Если приложение с высоким уровнем привилегий блокирует именованный мьютекс, попытка создать или удалить источник события приведет к тому, что приложение перестанет отвечать, пока блокировка не будет снята. If a highly privileged application locks the named mutex, trying to create or delete an event source causes the application to stop responding until the lock is released. Чтобы предотвратить возникновение этой проблемы, никогда не предоставляйте UnmanagedCode разрешение на ненадежный код. To help prevent this problem, never grant UnmanagedCode permission to untrusted code. Кроме того, UnmanagedCode разрешение, потенциально разрешающее обход других разрешений, может быть предоставлено только высоко доверенному коду. In addition, UnmanagedCode permission potentially allows other permissions to be bypassed and should only be granted to highly trusted code.
Приложения и службы должны выполнять запись в журнал приложений или в пользовательский журнал. Applications and services should write to the Application log or to a custom log. Драйверы устройств должны записывать в системный журнал. Device drivers should write to the System log. Если свойство не задано явным образом Log , по умолчанию в журнале событий используется журнал приложений. If you do not explicitly set the Log property, the event log defaults to the Application log.
Нет ничего защищать приложение от записи в качестве зарегистрированного источника. There is nothing to protect an application from writing as any registered source. Если приложению предоставлено Write разрешение, оно может записывать события для любого допустимого источника, зарегистрированного на компьютере. If an application is granted Write permission, it can write events for any valid source registered on the computer.
Используйте WriteEvent методы и WriteEntry для записи событий в журнал событий. Use the WriteEvent and WriteEntry methods to write events to an event log. Для записи событий необходимо указать источник события. перед записью первой записи с источником необходимо создать и настроить источник события. You must specify an event source to write events; you must create and configure the event source before writing the first entry with the source.
Создайте новый источник событий во время установки приложения. Create the new event source during the installation of your application. Это позволяет операционной системе обновлять свой список зарегистрированных источников событий и их конфигурацию. This allows time for the operating system to refresh its list of registered event sources and their configuration. Если операционная система не обновила список источников событий и вы пытаетесь написать событие с новым источником, операция записи завершится ошибкой. If the operating system hasn’t refreshed its list of event sources, and you try to write an event with the new source, the write operation will fail. Новый источник можно настроить с помощью EventLogInstaller объекта или CreateEventSource метода. You can configure a new source by using an EventLogInstaller object or the CreateEventSource method. Для создания нового источника событий необходимо иметь учетные данные администратора на компьютере. You must have administrative credentials on the computer to create a new event source.
Каждый источник может записывать только один журнал событий; Однако приложение может использовать несколько источников для записи в несколько журналов событий. Each source can write to only one event log at a time; however, your application can use multiple sources to write to multiple event logs. Например, приложению может потребоваться несколько источников, настроенных для различных журналов событий или разных файлов ресурсов. For example, your application might require multiple sources configured for different event logs or different resource files. Чтобы изменить сведения о конфигурации существующего источника, необходимо удалить источник, а затем создать его с новой конфигурацией. To change the configuration details of an existing source, you must delete the source and then create it with the new configuration. Если другие приложения или компоненты используют существующий источник, создайте новый источник с обновленной конфигурацией вместо удаления существующего источника. If other applications or components use the existing source, create a new source with the updated configuration instead of deleting the existing source.
Вы можете зарегистрировать источник событий в локализованных ресурсах для категории событий и строк сообщений. You can register the event source with localized resources for your event category and message strings. Приложение может записывать записи журнала событий с помощью идентификаторов ресурсов вместо указания фактических строковых значений. Your application can write event log entries by using resource identifiers instead of specifying the actual string values. EventLogInstaller EventSourceCreationData Дополнительные сведения о настройке источника с помощью файлов ресурсов см. в разделе классы и. Refer to the EventLogInstaller and EventSourceCreationData classes for more information about configuring your source with resource files.
Если приложение записывает строковые значения непосредственно в журнал событий, не нужно задавать свойства файла ресурсов для источника. If your application writes string values directly to the event log, you do not have to set the resource file properties for the source. Источник должен быть настроен либо для записи локализованных записей, либо для записи прямых строк. The source must be configured either for writing localized entries or for writing direct strings. Если приложение записывает записи, используя как идентификаторы ресурсов, так и строковые значения, необходимо зарегистрировать два отдельных источника. If your application writes entries using both resource identifiers and string values, you must register two separate sources. Например, можно настроить один источник с файлами ресурсов, а затем использовать этот источник в WriteEvent методе для записи записей, использующих идентификаторы ресурсов, в журнал событий. For example, configure one source with resource files, and then use that source in the WriteEvent method to write entries using resource identifiers to the event log. Затем создайте другой источник без файлов ресурсов и используйте этот источник в WriteEntry методе для записи строк непосредственно в журнал событий с помощью этого источника. Then create a different source without resource files, and use that source in the WriteEntry method to write strings directly to the event log using that source.
При записи событий необходимо по крайней мере указать либо строку сообщения, либо идентификатор ресурса для строки сообщения. When writing events, you must at least specify either a message string or the resource identifier for a message string. Другие свойства событий являются необязательными. Other event properties are optional. Примеры необязательных параметров событий включают следующее. Examples of optional event settings include the following:
Можно задать, EventLogEntryType чтобы указать значок, отображаемый Просмотр событий для записи. You can set the EventLogEntryType to specify the icon that the Event Viewer displays for the entry.
Можно указать идентификатор категории для события, если приложение использует категории для фильтрации событий. You can specify a category identifier for the event, if your application uses categories for filtering the events.
Если требуется связать дополнительные сведения с заданным событием, можно присоединить двоичные данные к записи события. You can attach binary data to your event entry if you want to associate additional information with a given event.
Ведение журнала событий потребляет место на диске, процессорное время и другие системные ресурсы. Event logging consumes disk space, processor time, and other system resources. Важно регистрировать только важную информацию. It is important to log only essential information. Рекомендуется размещать вызовы журнала событий в пути ошибки, а не в основном коде кода, чтобы они не влияли на производительность. We recommend that you place event log calls in an error path, rather than in the main code path, so they don’t adversely affect performance.
Список начальных значений свойств для экземпляра EventLog см. в разделе EventLog конструктор. For a list of initial property values for an instance of EventLog, see the EventLog constructor.
Конструкторы
Инициализирует новый экземпляр класса EventLog. Initializes a new instance of the EventLog class. Не связывает экземпляр с каким-либо журналом. Does not associate the instance with any log.
Инициализирует новый экземпляр класса EventLog. Initializes a new instance of the EventLog class. Связывает экземпляр с журналом на локальном компьютере. Associates the instance with a log on the local computer.
Инициализирует новый экземпляр класса EventLog. Initializes a new instance of the EventLog class. Связывает экземпляр с журналом на указанном компьютере. Associates the instance with a log on the specified computer.
Инициализирует новый экземпляр класса EventLog. Initializes a new instance of the EventLog class. Связывает экземпляр с журналом на указанном компьютере и создает или присваивает заданный источник классу EventLog. Associates the instance with a log on the specified computer and creates or assigns the specified source to the EventLog.
Свойства
Возвращает значение, показывающее, может ли компонент вызывать событие. Gets a value indicating whether the component can raise an event.
(Унаследовано от Component)
Возвращает объект IContainer, который содержит коллекцию Component. Gets the IContainer that contains the Component.
(Унаследовано от Component)
Возвращает значение, указывающее, находится ли данный компонент Component в режиме конструктора в настоящее время. Gets a value that indicates whether the Component is currently in design mode.
(Унаследовано от Component)
Возвращает или задает значение, определяющее, получает ли класс EventLog уведомления о событии EntryWritten. Gets or sets a value indicating whether the EventLog receives EntryWritten event notifications.
Возвращает содержимое журнала событий. Gets the contents of the event log.
Возвращает список обработчиков событий, которые прикреплены к этому объекту Component. Gets the list of event handlers that are attached to this Component.
(Унаследовано от Component)
Возвращает или задает имя журнала, из которого производится чтение или запись. Gets or sets the name of the log to read from or write to.
Возвращает понятное имя журнала событий. Gets the event log’s friendly name.
Возвращает или задает имя компьютера, на котором производится чтение или запись событий. Gets or sets the name of the computer on which to read or write events.
Возвращает или устанавливает максимальный размер журнала событий в килобайтах. Gets or sets the maximum event log size in kilobytes.
Возвращает количество дней, которое записи хранятся в журнале событий. Gets the number of days to retain entries in the event log.
Возвращает поведение при переполнении для хранения новых записей, когда файл журнала событий достигает максимального размера. Gets the configured behavior for storing new entries when the event log reaches its maximum log file size.
Получает или задает ISite объекта Component. Gets or sets the ISite of the Component.
(Унаследовано от Component)
Возвращает или задает имя источника, регистрируемого в журнале и используемого при записи в журнал событий. Gets or sets the source name to register and use when writing to the event log.
Возвращает или задает объект, используемый для маршалинга вызовов обработчика событий, возникающих в результате события записи в EventLog. Gets or sets the object used to marshal the event handler calls issued as a result of an EventLog entry written event.
Методы
Начинает инициализацию класса EventLog, используемого в форме или используемого другим компонентом. Begins the initialization of an EventLog used on a form or used by another component. Инициализация происходит во время выполнения. The initialization occurs at runtime.
Удаляет все записи из журнала событий. Removes all entries from the event log.
Закрывает журнал событий и удаляет дескрипторы чтения и записи. Closes the event log and releases read and write handles.
Задает допустимый источник событий для записи локализованных сообщений о событиях, используя указанные свойства конфигурации источника событий и соответствующий журнал событий. Establishes a valid event source for writing localized event messages, using the specified configuration properties for the event source and the corresponding event log.
Задает указанное имя источника в качестве допустимого источника событий для внесения записей в журнал на локальном компьютере. Establishes the specified source name as a valid event source for writing entries to a log on the local computer. Используя этот метод, можно также создать новый пользовательский журнал на локальном компьютере. This method can also create a new custom log on the local computer.
Устанавливает заданное имяисточника в качестве допустимого источника событий для внесения записей в журнал на указанном компьютере. Establishes the specified source name as a valid event source for writing entries to a log on the specified computer. Этот метод можно также использовать для создания нового пользовательского журнала на заданном компьютере. This method can also be used to create a new custom log on the specified computer.
Создает объект, который содержит всю необходимую информацию для создания прокси-сервера, используемого для взаимодействия с удаленным объектом. Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Унаследовано от MarshalByRefObject)
Удаляет журнал событий с локального компьютера. Removes an event log from the local computer.
Удаляет журнал событий с указанного компьютера. Removes an event log from the specified computer.
Удаляет регистрацию источника событий из журнала событий на локальном компьютере. Removes the event source registration from the event log of the local computer.
Удаляет регистрацию источника событий приложения с указанного компьютера. Removes the application’s event source registration from the specified computer.
Освобождает все ресурсы, занятые модулем Component. Releases all resources used by the Component.
(Унаследовано от Component)
Освобождает неуправляемые ресурсы, используемые журналом EventLog, и при необходимости освобождает также управляемые ресурсы. Releases the unmanaged resources used by the EventLog, and optionally releases the managed resources.
Завершает инициализацию класса EventLog, используемого в форме или другим компонентом. Ends the initialization of an EventLog used on a form or by another component. Инициализация происходит во время выполнения. The initialization occurs at runtime.
Определяет, равен ли указанный объект текущему объекту. Determines whether the specified object is equal to the current object.
(Унаследовано от Object)
Определяет наличие журнала на локальном компьютере. Determines whether the log exists on the local computer.
Определяет наличие журнала на заданном компьютере. Determines whether the log exists on the specified computer.
Выполняет поиск всех журналов событий на локальном компьютере и создает массив объектов EventLog, содержащих список. Searches for all event logs on the local computer and creates an array of EventLog objects that contain the list.
Выполняет поиск всех журналов событий на заданном компьютере и создает массив объектов EventLog, содержащих список. Searches for all event logs on the given computer and creates an array of EventLog objects that contain the list.
Служит хэш-функцией по умолчанию. Serves as the default hash function.
(Унаследовано от Object)
Извлекает объект обслуживания во время существования, который управляет политикой времени существования данного экземпляра. Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Унаследовано от MarshalByRefObject)
Возвращает объект, представляющий службу, предоставляемую классом Component или классом Container. Returns an object that represents a service provided by the Component or by its Container.
(Унаследовано от Component)
Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.
(Унаследовано от Object)
Получает объект службы времени существования для управления политикой времени существования для этого экземпляра. Obtains a lifetime service object to control the lifetime policy for this instance.
(Унаследовано от MarshalByRefObject)
Возвращает имя журнала, в котором зарегистрирован указанный источник. Gets the name of the log to which the specified source is registered.
Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.
(Унаследовано от Object)
Создает неполную копию текущего объекта MarshalByRefObject. Creates a shallow copy of the current MarshalByRefObject object.
(Унаследовано от MarshalByRefObject)
Изменяет поведение при внесении новых записей, когда файл журнала событий достигает максимального размера. Changes the configured behavior for writing new entries when the event log reaches its maximum file size.
Определяет локализованное имя для журнала событий, которое отображается в «Просмотре событий» сервера. Specifies the localized name of the event log, which is displayed in the server Event Viewer.
Определяет, зарегистрирован ли источник событий на локальном компьютере. Determines whether an event source is registered on the local computer.
Определяет, зарегистрирован ли источник событий на указанном компьютере. Determines whether an event source is registered on a specified computer.
Возвращает объект String, содержащий имя Component, если оно есть. Returns a String containing the name of the Component, if any. Этот метод не следует переопределять. This method should not be overridden.
(Унаследовано от Component)
Вносит в журнал событий запись сведений с заданным текстом сообщения. Writes an information type entry, with the given message text, to the event log.
Вносит в журнал событий следующие записи с заданным текстом сообщения: ошибка, предупреждение, сведения, аудит отказов или аудит успехов. Writes an error, warning, information, success audit, or failure audit entry with the given message text to the event log.
Вносит в журнал событий запись с заданным текстом сообщения и идентификатором события, который определяется приложением. Writes an entry with the given message text and application-defined event identifier to the event log.
Вносит в журнал событий запись с заданным текстом сообщения, идентификатором события и категорией, которая определяется приложением. Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log.
Вносит в журнал событий запись с заданным текстом сообщения, идентификатором события и категорией (которые определяются приложением), а затем добавляет в сообщение двоичные данные. Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log, and appends binary data to the message.
Вносит в журнал событий запись сведений с заданным текстом сообщения, используя указанный зарегистрированный источник. Writes an information type entry with the given message text to the event log, using the specified registered event source.
Вносит в журнал событий, используя указанный зарегистрированный источник, следующие записи с заданным текстом сообщения: ошибка, предупреждение, сведения, аудит отказов или аудит успехов. Writes an error, warning, information, success audit, or failure audit entry with the given message text to the event log, using the specified registered event source.
Вносит в журнал событий запись с заданным текстом сообщения и идентификатором события (который определяется приложением), используя указанный зарегистрированный источник событий. Writes an entry with the given message text and application-defined event identifier to the event log, using the specified registered event source.
Вносит в журнал событий запись с заданным текстом сообщения и идентификатором события и категорией (которые определяется приложением), используя указанный зарегистрированный источник событий. Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log, using the specified registered event source. С помощью category осуществляется фильтрация событий журнала в компоненте «Просмотр событий». The category can be used by the Event Viewer to filter events in the log.
Вносит в журнал событий запись с заданным текстом сообщения, идентификатором события и категорией (которые определяются приложением), используя указанный зарегистрированный источник событий, а затем добавляет в сообщение двоичные данные. Writes an entry with the given message text, application-defined event identifier, and application-defined category to the event log (using the specified registered event source) and appends binary data to the message.
Заносит записи журнала событий с данными события, строками замещения сообщения и связанными двоичными данными. Writes an event log entry with the given event data, message replacement strings, and associated binary data.
Вносит локализованные записи в журнал событий. Writes a localized entry to the event log.
Вносит в журнал событий запись с заданными данными сообщения, строками замещения сообщения и связанными двоичными данными, используя указанный зарегистрированный источник событий. Writes an event log entry with the given event data, message replacement strings, and associated binary data, and using the specified registered event source.
Вносит в журнал событий запись с заданными данными сообщения и строками замещения сообщения, используя указанный зарегистрированный источник событий. Writes an event log entry with the given event data and message replacement strings, using the specified registered event source.
События
Возникает при удалении компонента путем вызова метода Dispose(). Occurs when the component is disposed by a call to the Dispose() method.
(Унаследовано от Component)
Происходит при внесении записи в журнал событий на локальном компьютере. Occurs when an entry is written to an event log on the local computer.