title: boost log severity empty in the log message
body: <p>i am setting the formatter for log records, the severity field is printing empty in the final log message. The code compiles fine but not working as expected. please advise. The documentation on the boost log is very cryptic and unclear.</p>
  
  <pre><code>auto logFmt = (                                                         
                  boost::log::expressions::stream                                 
                  &lt;&lt;boost::log::expressions::format_date_time&lt;boost::posix_time::ptime&gt;("TimeStamp", "%Y-%m-%d:%H:%M:%S")
                  &lt;&lt;"|"&lt;&lt; boost::log::expressions::attr&lt;boost::log::trivial::severity_level&gt;("Severity")
                  &lt;&lt;"|pid:"&lt;&lt;boost::log::expressions::attr&lt;boost::log::process_id&gt;("ProcessID")
                  &lt;&lt;"|tid:"&lt;&lt;boost::log::expressions::attr&lt;boost::log::thread_id&gt;("ThreadID")
                  &lt;&lt;"| "&lt;&lt;boost::log::expressions::smessage);           
  </code></pre>
  
  <p>I am pasting the stand alone code snippet which is separated from the larger piece. </p>
  
  <pre><code>#ifndef BOOST_LOG_USE_NATIVE_SYSLOG
  #define BOOST_LOG_USE_NATIVE_SYSLOG
  #endif
  
  #include &lt;string&gt;
  #include &lt;fstream&gt;
  #include &lt;iostream&gt;
  #include &lt;stdexcept&gt;
  #include &lt;syslog.h&gt;
  #include &lt;boost/smart_ptr/shared_ptr.hpp&gt;
  #include &lt;boost/date_time/posix_time/posix_time_types.hpp&gt;
  #include &lt;boost/phoenix.hpp&gt;
  #include &lt;boost/log/core.hpp&gt;
  #include &lt;boost/log/trivial.hpp&gt;
  #include &lt;boost/log/expressions.hpp&gt;
  #include &lt;boost/log/sinks/sync_frontend.hpp&gt;
  #include &lt;boost/log/sinks/basic_sink_backend.hpp&gt;
  #include &lt;boost/log/sinks/syslog_backend.hpp&gt;
  #include &lt;boost/log/sinks/text_ostream_backend.hpp&gt;
  #include &lt;boost/log/sources/logger.hpp&gt;
  #include &lt;boost/log/sources/record_ostream.hpp&gt;
  #include &lt;boost/log/attributes/value_visitation.hpp&gt;
  #include &lt;boost/log/utility/manipulators/add_value.hpp&gt;
  #include &lt;boost/log/sinks/text_file_backend.hpp&gt;
  #include &lt;boost/log/utility/setup/console.hpp&gt;
  #include &lt;boost/log/utility/setup/common_attributes.hpp&gt;
  #include &lt;boost/log/sources/severity_logger.hpp&gt;
  #include &lt;boost/log/sources/record_ostream.hpp&gt;
  #include &lt;boost/log/attributes/timer.hpp&gt;
  #include &lt;boost/log/attributes/named_scope.hpp&gt;
  #include &lt;boost/log/support/date_time.hpp&gt;
  
  #define __LOCATION_TAG__ &lt;&lt;__FILE__&lt;&lt;"|"&lt;&lt;__LINE__&lt;&lt;"|"&lt;&lt;__FUNCTION__&lt;&lt;"()|"&lt;&lt;" "
  
  #define _fatal   BOOST_LOG_SEV(Logger::getLogger(), boost::log::v2_mt_posix::trivial::fatal)__LOCATION_TAG__
  #define _error   BOOST_LOG_SEV(Logger::getLogger(), boost::log::v2_mt_posix::trivial::error)__LOCATION_TAG__
  #define _warning BOOST_LOG_SEV(Logger::getLogger(), boost::log::v2_mt_posix::trivial::warning)__LOCATION_TAG__
  #define _info    BOOST_LOG_SEV(Logger::getLogger(), boost::log::v2_mt_posix::trivial::info)__LOCATION_TAG__
  #define _debug   BOOST_LOG_SEV(Logger::getLogger(), boost::log::v2_mt_posix::trivial::debug)__LOCATION_TAG__
  #define _trace   BOOST_LOG_SEV(Logger::getLogger(), boost::log::v2_mt_posix::trivial::trace)__LOCATION_TAG__
  
  
  class Logger
  {
      class custom_backend :
          public boost::log::sinks::basic_sink_backend&lt;
          boost::log::sinks::combine_requirements&lt;
          boost::log::sinks::formatted_records,
          boost::log::sinks::concurrent_feeding,
          boost::log::sinks::flushing
          &gt;::type
          &gt;
      {
          public:
              typedef char                               char_type; // Character type.
              typedef std::basic_string&lt; char_type &gt;   string_type; // Formatted string type.
              explicit custom_backend()
              {
                  return;
              }
  
              void consume(boost::log::record_view const&amp; rec,
                      string_type const&amp; formatted_message)
              {
                  std::cerr&lt;&lt;formatted_message&lt;&lt;std::endl;
                  return;
              }
  
              void flush()
              {
                  return;
              }
      };
  
      public:
      typedef boost::log::sinks::synchronous_sink&lt; custom_backend &gt; sink_t;
      void initialize(std::string tag)
      {
          auto logFmt = (
                  boost::log::expressions::stream
                  &lt;&lt;boost::log::expressions::format_date_time&lt;boost::posix_time::ptime&gt;("TimeStamp", "%Y-%m-%d:%H:%M:%S")
                  &lt;&lt;"|"&lt;&lt; boost::log::expressions::attr&lt;boost::log::trivial::severity_level&gt;("Severity")
                  &lt;&lt;"|pid:"&lt;&lt;boost::log::expressions::attr&lt;boost::log::process_id&gt;("ProcessID")
                  &lt;&lt;"|tid:"&lt;&lt;boost::log::expressions::attr&lt;boost::log::thread_id&gt;("ThreadID")
                  &lt;&lt;"| "&lt;&lt;boost::log::expressions::smessage);
  
          cbackend.reset(new custom_backend());
          custom_sink.reset(new sink_t(cbackend));
          custom_sink-&gt;set_formatter(logFmt);
          boost::log::core::get()-&gt;add_sink(custom_sink);
          return;
      }
  
      static Logger&amp; getInstance()
      {
          static Logger logger;
          return logger;
      }
  
      void finalize()
      {
          return;
      }
  
      static boost::log::sources::logger_mt &amp; getLogger()
      {
          return _lg;
      }
  
      private:
      static boost::log::sources::logger_mt _lg;
      boost::shared_ptr&lt; custom_backend &gt; cbackend;
      boost::shared_ptr&lt; sink_t &gt; custom_sink;
  };
  
  boost::log::sources::logger_mt Logger::_lg;
  
  int main(int ac, char **av)
  {
      auto lg = Logger::getInstance();
      lg.initialize("hello");
      _info&lt;&lt;"hello world."&lt;&lt;std::endl;
      _error&lt;&lt;"hello world."&lt;&lt;std::endl;
      return 0;
  }
  </code></pre>