I think you need to read the attribute page in details but you mostly get it apparently. http://boost-log.sourceforge.net/libs/log/doc/html/log/tutorial/attributes.h...
Basically, you don't associate attribute to loggers but to log record. In your case I think the simplest way would be to have a different logging macro (or function), that would do the log record setup and send manually but will add necessary attributes in the middle.
That's the approach I'd like to avoid, due to some legacy code limitations (I'm moving to Boost.Log from some other logger). But it turns out that it's possible to attach attributes to loggers in a straightforward way: BOOST_LOG_ATTRIBUTE_KEYWORD(my_attr, "my_attr", int) logger->add_attribute("my_attr", attrs::constant<int>(i)); It works as I expected and solves my problem. Thanks.