What I have now:
.
//Windows Event Log
Poco::EventLogChannel* elChannel = new Poco::EventLogChannel("App");
//Simple file Log
Poco::SimpleFileChannel* sfChannel = new Poco::SimpleFileChannel();
sfChannel->setProperty("path", "log.txt");
sfChannel->setProperty("rotation", "10 M");
//Splitter Channel
Poco::SplitterChannel* sChannel = new Poco::SplitterChannel();
sChannel->addChannel(sfChannel);
sChannel->addChannel(elChannel);
logger().root().setChannel(sChannel);
logger().root().setLevel(Poco::Message::PRIO_INFORMATION);
I would like to have different log levels per channel in the splitter:
This way only messages above WARNING would go to Windows Event Viewer.
Could this be achieved in some way using standard Poco::Logger?
Logging level is per Logger, not per Channel, so you will have to have two loggers. See Logger example. To avoid inconvenience of having to log the same thing twice, you can write your own "splitter" function that wraps the loggers and logs the same messages to both.