#1145·NLog

Add namespace filters for ${callsite}

Author: 304NotModifiedCreated Jan 9, 2016Updated Apr 4, 2026
Labelsfeature

The ${callsite} renders sometimes unwanted methods as callsite, e.g. custom libraries etc.

This can be prevented with hide assemblies, but it's too limited (only assembly level and config only in API). (AKA blacklisted assemblies, see http://nlog-project.org/2015/01/12/nlog-3-2-0-is-released.html)

Proposal, add more filters, by namespace level (equavalent as a <logger>rule)

Proposal/example:

xml
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
      autoReload="true"
      throwExceptions="true"
      internalLogLevel="Debug" internalLogFile="c:\temp\nlog-window.log" >


  <callsite-filters>
    <namespace-filter value="common.logging.*" ></namespace-filter>
  </callsite-filters>

  <targets>

note: due to current code, this cannot be easily a property of ${callsite}