
Hi All, I am trying to introduce boost::log into one of projects I am working on. The application already does some logging to the trace file and additionaly uses Windows Event Log to post messages. What I am going to do is to replace the existing logging framework with boost::log. Being frank - these are my first attempts at boost at all. I am following exactly the steps from the examples section of the documentation. I have written the following code: boost::shared_ptr< sinks::event_log_backend > backend( new sinks::event_log_backend(( keywords::message_file = "<path to library>.dll", keywords::log_name = "My Application", keywords::log_source = "My Source" )) ); sinks::event_log::event_composer composer( sinks::event_log::direct_event_id_mapping<int>("EventId") ); composer[MY_APPLICATION_SESSION_CREATION_FAILURE] % fmt::message(); backend->set_event_composer(composer); boost::shared_ptr<sinks::synchronous_sink< sinks::event_log_backend>> sink( new sinks::synchronous_sink< sinks::event_log_backend >(backend) ); sink->set_filter( (flt::attr<SeverityLevel>("Severity") == info || flt::attr<SeverityLevel>("Severity") == warning || flt::attr<SeverityLevel>("Severity") == error || flt::attr<SeverityLevel>("Severity") == fatal) && flt::has_attr<int>("EventId") ); sinks::event_log::custom_event_type_mapping<SeverityLevel> mapping("Severity"); mapping[trace] = sinks::event_log::info; mapping[debug] = sinks::event_log::info; mapping[info] = sinks::event_log::info; mapping[warning] = sinks::event_log::warning; mapping[error] = sinks::event_log::error; mapping[fatal] = sinks::event_log::error; sink->locked_backend()->set_event_type_mapper(mapping); logging::core::get()->add_sink(sink); I am building the code with Visual Studio 2010. Unfortunately I get the following error: 1>F:\boost\boost\boost/function/function_template.hpp(153): error C2064: term does not evaluate to a function taking 3 arguments 1> class does not define an 'operator()' or a user defined conversion operator to a pointer-to-function or reference-to-function that takes appropriate number of arguments 1> F:\boost\boost\boost/function/function_template.hpp(147) : while compiling class template member function 'void boost::detail::function::void_function_obj_invoker3<FunctionObj,R,T0,T1,T2>::invoke(boost::detail::function::function_buffer &,T0,T1,T2)' 1> with 1> [ 1> FunctionObj=boost::log_mt_nt5::formatters::fmt_message<char>, 1> R=void, 1> T0=std::basic_ostream<char,std::char_traits<char>> &, 1> T1=const boost::log_mt_nt5::basic_attribute_values_view<char> &, 1> T2=const std::basic_string<char,std::char_traits<char>,std::allocator<char>> & 1> ] 1> F:\boost\boost\boost/function/function_template.hpp(907) : see reference to class template instantiation 'boost::detail::function::void_function_obj_invoker3<FunctionObj,R,T0,T1,T2>' being compiled 1> with 1> [ 1> FunctionObj=boost::log_mt_nt5::formatters::fmt_message<char>, 1> R=void, 1> T0=std::basic_ostream<char,std::char_traits<char>> &, 1> T1=const boost::log_mt_nt5::basic_attribute_values_view<char> &, 1> T2=const std::basic_string<char,std::char_traits<char>,std::allocator<char>> & 1> ] 1> F:\boost\boost\boost/function/function_template.hpp(722) : see reference to function template instantiation 'void boost::function3<R,T0,T1,T2>::assign_to<Functor>(Functor)' being compiled 1> with 1> [ 1> R=void, 1> T0=std::basic_ostream<char,std::char_traits<char>> &, 1> T1=const boost::log_mt_nt5::basic_attribute_values_view<char> &, 1> T2=const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, 1> Functor=boost::log_mt_nt5::formatters::fmt_message<char> 1> ] 1> F:\boost\boost\boost/log/sinks/event_log_backend.hpp(678) : see reference to function template instantiation 'boost::function3<R,T0,T1,T2>::function3<FormatterT>(Functor,int)' being compiled 1> with 1> [ 1> R=void, 1> T0=std::basic_ostream<char,std::char_traits<char>> &, 1> T1=const boost::log_mt_nt5::basic_attribute_values_view<char> &, 1> T2=const std::basic_string<char,std::char_traits<char>,std::allocator<char>> &, 1> FormatterT=boost::log_mt_nt5::formatters::fmt_message<char>, 1> Functor=boost::log_mt_nt5::formatters::fmt_message<char> 1> ] 1> LoggingFacility.cpp(111) : see reference to function template instantiation 'boost::log_mt_nt5::sinks::event_log::basic_event_composer<CharT>::event_map_reference &boost::log_mt_nt5::sinks::event_log::basic_event_composer<CharT>::event_map_reference::operator %<boost::log_mt_nt5::formatters::fmt_message<CharT>>(const FormatterT &)' being compiled 1> with 1> [ 1> CharT=char, 1> FormatterT=boost::log_mt_nt5::formatters::fmt_message<char> 1> ] The problem seems to be caused by the following expression: composer[MY_APPLICATION_SESSION_CREATION_FAILURE] % fmt::message(); Other backends work flawlessly. Event log files (.h/.mc/.dll) are OK too. Any help? Regards, Konrad Rybacki.