Simplest way to extend your logs with domain information is to use DomainLoggerContext
instead of the defualt one:
LogManager.context = new DomainLoggerContext(TopLevelDomain.DOMAIN);
This way default messageFactory for every logger will become a DomainMessageFactory with specified domain.
Essentially a copy of a standard TraceEverythingConfiguration
but using DomainLayout
for the trace target.
Creates a IMessage
instance implementation which contains a domain information. Messages created by this factory implement IDomainMessage
interface which is extension of standard IMessage
.
Basic implementation of a layout which deals with the additional domain information. Not that fallback behavior is necessary because not every message is IDomainMessage
.
Basic implementation of a filter that handles domain information. For the same reason as DomainLayout
filter has to deal with potentially missing the domain information.