The event log source in the event log is "Learning", which lines up nicely with the property in the Learning.properties file. The message, however, is completely blank. If I remove the registry key under HKLM\System\CurrentControlSet\Services\EventLog\Application\Learning that signifies the PocoFoundation.dll, the event viewer displays the usual "The description for Event ID 4096 from source Learning cannot be found" message, followed by the insertion string I would expect.
The documentation (http://pocoproject.org/poco/docs/Poco.EventLogChannel.html) says "To work properly, the EventLogChannel class requires that either the PocoFoundation.dll or the PocoMsg.dll Dynamic Link Library containing the message definition resources can be found in $PATH.", and I've used both the PocoFoundation.dll and PocoFoundationd.dll with the same blank results. I cannot seem to locate PocoMsg.dll on my computer, though I've found the pocomsg.rc and associated BIN file under Foundation/src, but I'm not sure how to turn those into a dll.
FWIW, I see the same problem on a Windows 7 machine using Visual Studio 2008, and a Windows XP machine using Visual C++ Express.
Any suggestions on what I'm missing?
Here's a sample app that I'm using to test...
Learning.properties:
- Code: Select all
logging.loggers.eventlog.channel.class = EventLogChannel
logging.loggers.eventlog.channel.name = Learning
logging.loggers.eventlog.channel.logfile = Application
logging.loggers.eventlog.level = debug
logging.loggers.console.channel.class = ConsoleChannel
logging.loggers.console.channel.pattern = %s: [%p] %t
logging.loggers.console.level = debug
application.logger = eventlog
main.h:
- Code: Select all
#include <vector>
#include <string>
#include <iostream>
#include <Poco/Util/Application.h>
using std::vector;
using std::string;
using std::cout;
using std::endl;
using Poco::Util::Application;
class SampleApp : public Application {
protected:
virtual int main(const vector<string>& args);
virtual void initialize(Application& self);
};
main.cpp:
- Code: Select all
#include "main.cpp"
int SampleApp::main(const vector<string>& args) {
logger().debug("This is a debug message");
return 0;
}
void SampleApp::initialize(Application& self) {
loadConfiguration();
Application::initialize(self);
}
POCO_APP_MAIN(SampleApp);





