-
Notifications
You must be signed in to change notification settings - Fork 1.4k
AspResponse target
Rolf Kristensen edited this page Oct 8, 2023
·
9 revisions
Outputs log messages through the ASP Response object.
Supported in .NET and Mono
<targets>
<target xsi:type="AspResponse" name="String" addComments="Boolean" layout="Layout" />
</targets>
Read more about using the configuration file.
- name - Name of the target
-
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:withexception=true}
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](Configuration file) which is loaded into the web server process:
<?xml version="1.0" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="aspnet" xsi:type="ASPResponse" layout="${logger} ${message}" />
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="aspnet" />
</rules>
</nlog>
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
- Articles about NLog
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json