AspResponse target

Julian edited this page Jan 25, 2015 · 2 revisions
Clone this wiki locally

Outputs log messages through the ASP Response object.

Supported in .NET and Mono

Configuration Syntax

  <target xsi:type="AspResponse" name="String" addComments="Boolean" layout="Layout" />

Read more about using the configuration file.


General Options

name - Name of the target

Layout Options

addComments - Indicates whether to add comments around all written texts. Boolean layout - Layout used to format log messages. Layout Required. Default: {longdate}|${level:uppercase=true}|${logger}|${message}


This target is usable when using classic ASP (not ASP.NET). In order to use this target, put the following code in the configuration file which is loaded into the web server process:

<?xml version="1.0" ?>
<nlog xmlns=""
        <target name="aspnet" xsi:type="ASPResponse" layout="${logger} ${message}" />
        <logger name="*" minlevel="Debug" writeTo="aspnet" />