Reputation: 2325
How can i send log messages to windows event log using Pantheios?
and
If i do it from multiple process using Pantheious , will it be process safe? Will i get craches?
Upvotes: 0
Views: 163
Reputation: 17285
You need to do the following:
You need to link with be.WindowsEventLog.
On Windows this can be done with implicit linking by adding #include <pantheios/implicit_link/be.WindowsEventLog.h>
to one of your compilation units.
Also, you must define the application specific function pantheios_be_WindowsEventLog_calcCategoryAndEventId()
(as specified in the tiny note in the docs: Note This is an application-specified function..
An example, bare-simple implementation can be found in pantheios-folder\test\scratch\test.scratch.api\test.scratch.api.cpp
:
// The following allows this to be used with the Windows EventLog back-end.
PANTHEIOS_CALL(void) pantheios_be_WindowsEventLog_calcCategoryAndEventId(
int /* backEndId */
, int /* severity */
, pantheios::uint16_t* category
, pantheios::uint32_t* eventId
) /* throw() */
{
// NOTE: A proper implementation would specify non-0 values here that
// identify the requisite event identifier and category within the
// associated message file(s).
*eventId = 0;
*category = 0;
}
Documentation for category
and eventID
can be found on the MSDN Event Logging docs here and here respectively.
Upvotes: 3
Reputation: 3565
Use be.WindowsEventLog.
No, I don't believe so, any more than you would using Event Log from multiple processes.
Upvotes: 0