gabime / spdlog

Fast C++ logging library.
Other
23.88k stars 4.48k forks source link

The description for Event ID 1000 from source XXX cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. #3161

Closed siddjain closed 1 week ago

siddjain commented 2 weeks ago

I am using this library to log to the windows event log like this:

        auto sink = std::make_shared<spdlog::sinks::win_eventlog_sink_mt>(EVENT_SOURCE);
        sink->set_pattern("%v");
        auto logger = std::make_shared<spdlog::logger>("eventlog", sink);        
        logger->set_level(spdlog::level::trace); 
        spdlog::set_default_logger(logger);
        spdlog::debug("XXX");

I created the EVENT_SOURCE previously under Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\.

When I do this, there are at least 2 problems I am seeing:

Problem 1: The description for Event ID 1000 from source XXX cannot be found.

The description for Event ID 1000 from source XXX cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

XXX

The message resource is present but the message was not found in the message table

Problem 2: All messages are logged at Information level in the event log irrespective of whether I use spdlog::debug, spdlog::info, spdlog::error etc.

Is there any way to fix these issues?

tt4g commented 2 weeks ago

I am not familiar with Windows events, but it seems that not creating an EventMessageFile in Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\EVENT_SOURCE is causing that error message to be reported.

See:

See also:

siddjain commented 2 weeks ago

Thanks. Yes that seems to be the problem.


From: tt4g @.> Sent: Wednesday, August 28, 2024 2:12 PM To: gabime/spdlog @.> Cc: siddjain @.>; Author @.> Subject: Re: [gabime/spdlog] The description for Event ID 1000 from source XXX cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. (Issue #3161)

I am not familiar with Windows events, but it seems that not creating an EventMessageFile in Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\EVENT_SOURCE is causing that error message to be reported.

See:

See also:

— Reply to this email directly, view it on GitHubhttps://github.com/gabime/spdlog/issues/3161#issuecomment-2316260486, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFZEMINMGZQXIYRGKYW4LTZTY4MBAVCNFSM6AAAAABNITJHS6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJWGI3DANBYGY. You are receiving this because you authored the thread.Message ID: @.***>