Windows event log services error

Windows Event Log Error Constants

The following are the error codes that Windows Event Log defines.

ERROR_EVT_INVALID_CHANNEL_PATH

The specified channel path is not valid.

ERROR_EVT_INVALID_QUERY

The specified query is not valid.

ERROR_EVT_PUBLISHER_METADATA_NOT_FOUND

The provider metadata cannot be found in the resource.

ERROR_EVT_EVENT_TEMPLATE_NOT_FOUND

The template for an event definition cannot be found in the resource.

ERROR_EVT_INVALID_PUBLISHER_NAME

The specified provider name is not valid.

ERROR_EVT_INVALID_EVENT_DATA

The event data raised by the provider is not compatible with the event template definition in the provider’s manifest.

ERROR_EVT_CHANNEL_NOT_FOUND

The specified channel cannot be found. Check the channel configuration.

ERROR_EVT_MALFORMED_XML_TEXT

The specified XML text was not well-formed. For more information, call the EvtGetExtendedStatus function.

ERROR_EVT_SUBSCRIPTION_TO_DIRECT_CHANNEL

You cannot subscribe to an Analytic or Debug channel; the events for an Analytic or Debug channel go directly to a log file and cannot be subscribed to.

ERROR_EVT_CONFIGURATION_ERROR

A configuration error occurred.

ERROR_EVT_QUERY_RESULT_STALE

The query result is not valid. This may be due to the log being cleared or rolling over after the query result was created. Release the query result object and reissue the query.

ERROR_EVT_QUERY_RESULT_INVALID_POSITION

The cursor for the query result is not pointing to a valid position.

ERROR_EVT_NON_VALIDATING_MSXML

The registered MSXML parser does not support validation.

ERROR_EVT_FILTER_ALREADYSCOPED

An expression can be followed by a change of scope operation only if the expression evaluates to a node set and is not already part of some other change of scope operation.

ERROR_EVT_FILTER_NOTELTSET

Cannot perform a step operation from a term that does not represent an element set.

ERROR_EVT_FILTER_INVARG

The arguments on the left side of a binary operator must be either attributes, nodes, or variables, and the arguments on the right side must be constants.

ERROR_EVT_FILTER_INVTEST

A step operation must involve either a node test or, in the case of a predicate, an algebraic expression against which to test each node in the node set identified by the preceding node set can be evaluated.

ERROR_EVT_FILTER_INVTYPE

This data type not supported.

ERROR_EVT_FILTER_PARSEERR

A syntax error occurred at the specified position.

ERROR_EVT_FILTER_UNSUPPORTEDOP

This operator is unsupported by this implementation of the filter.

ERROR_EVT_FILTER_UNEXPECTEDTOKEN

The token encountered was unexpected.

ERROR_EVT_INVALID_OPERATION_OVER_ENABLED_DIRECT_CHANNEL

The requested operation cannot be performed over an enabled Analytic or Debug channel. You must disable the channel before performing the requested operation.

ERROR_EVT_INVALID_CHANNEL_PROPERTY_VALUE

The channel property contains a value that is not valid. The value’s type may not be valid, the value may be out of range, or the value cannot be updated or is not supported for this type of channel.

ERROR_EVT_INVALID_PUBLISHER_PROPERTY_VALUE

The provider property contains a value that is not valid. The value’s type may not be valid, the value may be out of range, or the value cannot be updated or is not supported for this type of provider.

Читайте также:  Remote desktop connection mac os ppc

ERROR_EVT_CHANNEL_CANNOT_ACTIVATE

The channel failed to activate.

ERROR_EVT_FILTER_TOO_COMPLEX

The XPath expression exceeded supported complexity. Simplify the expression or split it into two or more simple expressions.

ERROR_EVT_MESSAGE_NOT_FOUND

The message resource is present, but the message is not found in the string or message table.

ERROR_EVT_MESSAGE_ID_NOT_FOUND

The message identifier cannot be found.

ERROR_EVT_UNRESOLVED_VALUE_INSERT

The substitution string for the insert index cannot be found.

ERROR_EVT_UNRESOLVED_PARAMETER_INSERT

The description string for parameter reference (%1) cannot be found.

ERROR_EVT_MAX_INSERTS_REACHED

The maximum number of replacements has been reached.

ERROR_EVT_EVENT_DEFINITION_NOT_FOUND

The event definition cannot be found for the event identifier.

ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND

The locale-specific resource for the desired message is not present.

ERROR_EVT_VERSION_TOO_OLD

The resource is too old to be compatible.

ERROR_EVT_VERSION_TOO_NEW

The resource is too new to be compatible.

ERROR_EVT_CANNOT_OPEN_CHANNEL_OF_QUERY

The channel at the specified index of the query cannot be opened.

ERROR_EVT_PUBLISHER_DISABLED

The provider has been disabled and its resources are not available. This can occur when the provider is uninstalled or upgraded.

ERROR_EVT_FILTER_OUT_OF_RANGE

Attempted to create a numeric type that is outside of its valid range.

1108(S): The event logging service encountered an error while processing an incoming event published from %1.

Applies to

  • Windows 10
  • Windows Server 2016

Event Description:

This event generates when event logging service encountered an error while processing an incoming event.

It typically generates when logging service will not be able to correctly write the event to the event log or some parameters were not passed to logging service to log the event correctly. You will typically see a defective or incorrect event before 1108.

For example, event 1108 might be generated after an incorrect 4703 event:

NoteВ В For recommendations, see Security Monitoring Recommendations for this event.

Event XML:

Required Server Roles: None.

Minimum OS Version: Windows Server 2008 R2, Windows 7.

Event Versions: 0.

Field Descriptions:

%1 [Type = UnicodeString]: the name of security event source from which event was received for processing. You can see all registered security event source names in this registry path: “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Security”. Here is an example:

Security Monitoring Recommendations

For 1108(S): The event logging service encountered an error while processing an incoming event published from %1.

  • We recommend monitoring for all events of this type and checking what the cause of the error was.

—>

Windows Event Log Service not starting or is unavailable

Windows Event Log service maintains a set of event logs that the system, system components, and applications use to record events. The service exposes functions that allow programs to maintain and manage the event logs and perform operations on the logs, such as archiving and clearing. As such, administrators can maintain event logs and perform administrative tasks requiring administrator privileges.

Windows Event Log Service Not Starting or Running

For some unknown reason, if you find you are having difficulty starting the following, it is quite possible that one of the reasons could be that Windows Event Log Service is Not Running.

  • Task Scheduler
  • Windows Event Calendar
  • Messenger Sharing Folders
Читайте также:  Windows 10 upgrade 24074 exe

In such a scenario, you may get error messages like:

Event Log service is unavailable. Verify that the service is running

Windows could not start the Windows Event Log service on Local Computer

First, reboot your system and see if it helps. Sometimes a simple restart helps reinitialize this service. If the Windows Event Log shows as being started, re-start it from Services Manager.

To check if the Windows Event Log service is started or stopped, Run services.msc and hit Enter to open the Services Manager. Here, again right-click on Windows Event Log Service, check up its Properties.

Ensure that the Startup type is set on Automatic and that the services is Started; and that it runs in the Local Service account.

Also ensure in the Recovery tab, all three drop-down boxes, show the option as ‘Restart the Service’, in case of Failure. Reboot if required.

At times the Windows Event Log Service still will not start, and you may instead get the following error message:

System cannot find the file specified

In this case, open the following folder:

This logs folder contains Event Logs in .evtx format and can only be read with the Event Viewer. Give this logs folder Read-Write access rights and see if it helps.

You might also want to do the following.

Open Registry Editor and navigate to the following key:

Double-click ObjectName and ensure that its value is set at NT AUTHORITY\LocalService. If it is not, then change it.

If it still does not help, run the System File Checker and go through its logs.

Are there any log file about Windows Services Status?

I want to figure out when the services was start up and terminated. Are there any kind log file about it?

4 Answers 4

Take a look at the System log in Windows EventViewer ( eventvwr from the command line).
You should see entries with source as ‘Service Control Manager’. e.g. on my WinXP machine,

Under Windows 7, open the Event Viewer. You can do this the way Gishu suggested for XP, typing eventvwr from the command line, or by opening the Control Panel, selecting System and Security, then Administrative Tools and finally Event Viewer. It may require UAC approval or an admin password.

In the left pane, expand Windows Logs and then System. You can filter the logs with Filter Current Log. from the Actions pane on the right and selecting «Service Control Manager.» Or, depending on why you want this information, you might just need to look through the Error entries.

The actual log entry pane (not shown) is pretty user-friendly and self-explanatory. You’ll be looking for messages like the following:

«The Praxco Assistant service entered the stopped state.»
«The Windows Image Acquisition (WIA) service entered the running state.»
«The MySQL service terminated unexpectedly. It has done this 3 time(s).»

Windows service. Поиск системных ошибок и отображение их в WinForm C#

В этой статье мы разберем как с нуля создать приложение, которое будет работать со службами windows и отображать системные ошибки в WinForm (C#).

План этой статьи:

  • Создание службы
  • Event Viewer
  • Код службы
  • Проверка работы службы(Запуск службы вручную)
  • Отображение WinForm
Читайте также:  Windows 10 исчез значок блютуз

Создание службы

Открываем Visual Studio. Дальше File → New → Project → (Windows Desktop) → Windows Service (.Net Framework) → Ok.

Дальше нужно создать установщик. В открывшемся окне щелкаем ПКМ и выбираем «Add Installer». У вас создастся «ProjectInstaller.cs[Design]» после чего нужно будет перейти к коду «F7» или ПКМ «View Code». Нужно найти строку «InitializeComponent();», поставить на нее курсор и нажать «F12», дальше нужно добавить следующие строки:

Но добавлять эти строки нужно только в следующей последовательности и месте. Иначе будет ошибка при установке сервиса.

Event Viewer

Это нужно для проверки правильной работы нашей программы.

Event Viewer — программа для просмотра журнала событий которая есть на каждом компьютере с windows. Каждая программа, которая запускается на компьютере, публикует уведомление в журнале событий до того, как останавливается. Любой доступ к системе, изменение безопасности, подстройка операционной системы, аппаратный сбой и сбой драйвера — все это попадает в журнал событий. Event Viewer сканирует файлы текстового журнала, объединяет их и помещает в интерфейс.

Как его открыть? — Пуск → Event Viewer(в поиске) → «Просмотр журналов событий».

Дальше «Настраиваемые представления (Custom Views)» → «События управления (Administrative Events)». Тут мы можем увидеть все ошибки, предупреждения и информацию о них.

Есть 3 типа журнала: приложение(Application), системные(System) и безопасность(Security). Нам нужен только системный(System).

Код службы

Находим файл .cs с названием службы, у меня это «Service1.cs», открываем. В файле должно быть заготовлено 2 переопределенных метода:

  • OnStart(string[] args) — выполняется при запуске службы,
  • OnStop() — выполняется при остановке службы.

Есть так же еще несколько методов но они нам сейчас не потребуются. Найти их можно самостоятельно.

Данные которые мы получаем будем хранить в обновляемом текстовом файле, поэтому добавляем

Добавляем код в метод OnStart(string[] args):

Дальше нужно собрать решение «Solution» -> «Rebuild Solution». После успешной сборки можно проверять работу.

Проверка работы службы(Запуск службы вручную)

Службу windows нельзя запускать как обычное приложение. Можно запустить только через командную строку от имени администратора.

Запускаем командную строку от имени администратора. Ввести следующие команды:

Дальше нажимаем клавишу Win+R. Вводим «Services.msc». Находим в списке свой сервис, нажимаем на него, и нажимаем «Запустить(Start)». После успешного запуска сформируется файл по указанному в коде пути в котором будет находиться список системных ошибок.
Не забываем удалить службу после проверки.

Отображение WinForm

Для отображения в консоли если постараться то можно найти статьи, но для отображения в WinForm я так и не нашла, так что вот. По умолчанию проект службы создается типа «Application». Для отображения через консоль этот параметр в настройках нужно поменять, для WinForm оставить как есть. Дальше нужно добавить форму в проект. «WindowsService1» → ПКМ → Add → Windows Form → Add. И делаем примерно следующий дизайн. Дальше меняем файл «Program.cs».

И меняем метод Main:

Добавляем новый класс «SystemError». («WindowsService1» -> ПКМ -> Add -> Class -> Add). Тут мы будем хранить данные об ошибках. Меняем его:

Дальше в «Service1.cs» добавляем метод «RunFromForm(string[] args)» который запускает службу.

Добавляем новый класс «GetListErrors». («WindowsService1» -> ПКМ -> Add -> Class -> Add). Тут мы будем доставать данные из файла. Добавляем using:

Дальше меняем код формы «Form1.cs». Добавляем using:

Теперь можно запускать службу как обычное приложение. Выглядит результат следующим образом:

Оцените статью