The log4net way to “select” applications is filtering. In your scenario, you will need a way to create several add-ons, each of which represents a well-defined stream, as well as filters in each application that go through messages only from the corresponding stream.
Since the thread id is not deterministic, you will need something else to do the filtering. I assume that you yourself control the creation of these threads and assume that each thread registers an identifier in a property in ThreadContext . You can then use the PropertyFilter to filter messages based on identifiers.
, , , threadId .
<appender name="x">
<filter type="log4net.Filter.Property">
<key value="threadId" />
<stringToMatch value="threadX" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
...
</appender>
<appender name="y">
<filter type="log4net.Filter.Property">
<key value="threadId" />
<stringToMatch value="threadY" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
...
</appender>
<root>
<appender-ref name="x" />
<appender-ref name="y" />
</root>