${aspnet-application:variable=myvariable} - produces "123"
${aspnet-application:variable=anothervariable} - produces "01/01/2006 00:00:00"
${aspnet-application:variable=anothervariable:culture=pl-PL} - produces "2006-01-01 00:00:00"
${aspnet-application:variable=myvariable:padding=5} - produces " 123"
${aspnet-application:variable=myvariable:padding=-5} - produces "123 "
${aspnet-application:variable=stringvariable:upperCase=true} - produces "AAA BBB"
${aspnet-item:variable=myvariable} - produces "123"
${aspnet-item:variable=anothervariable} - produces "01/01/2006 00:00:00"
${aspnet-item:variable=anothervariable:culture=pl-PL} - produces "2006-01-01 00:00:00"
${aspnet-item:variable=myvariable:padding=5} - produces " 123"
${aspnet-item:variable=myvariable:padding=-5} - produces "123 "
${aspnet-item:variable=stringvariable:upperCase=true} - produces "AAA BBB"
${aspnet-mvc-action}
${aspnet-mvc-controller}
${aspnet-request-contenttype}
${aspnet-request-cookie:OutputFormat=Flat}
${aspnet-request-cookie:OutputFormat=Json}
${aspnet-request-cookie:OutputFormat=Json:CookieNames=username}
${aspnet-request-cookie:OutputFormat=Json:Exclude=access_token}
${aspnet-request-form} - Produces - All Form Data from the Request with each key/value pair separated by a comma.
${aspnet-request-form:Include=id,name} - Produces - Only Form Data from the Request with keys "id" and "name".
${aspnet-request-form:Exclude=id,name} - Produces - All Form Data from the Request except the keys "id" and "name".
${aspnet-request-form:Include=id,name:Exclude=id} - Produces - Only Form Data from the Request with key "name" ( takes precedence over ).
${aspnet-request-form:ItemSeparator=${newline}} - Produces - All Form Data from the Request with each key/value pair separated by a new line.
${aspnet-request-headers:OutputFormat=Flat}
${aspnet-request-headers:OutputFormat=Json}
${aspnet-request-headers:OutputFormat=Json:HeaderNames=username}
${aspnet-request-headers:OutputFormat=Json:Exclude=access_token}
${aspnet-request-host}
${aspnet-request-method} - Produces - Post.
${aspnet-request-ip}
${aspnet-request-posted-body} - Produces - {username:xyz,password:xyz}
${aspnet-request-querystring:OutputFormat=Flat}
${aspnet-request-querystring:OutputFormat=Json}
${aspnet-request-referrer} - Produces - Referrer URL String from the Request.
${aspnet-request-url:IncludeQueryString=true} - produces http://www.exmaple.com/?t=1
${aspnet-request-url:IncludeQueryString=false} - produces http://www.exmaple.com/
${aspnet-request-url:IncludePort=true} - produces http://www.exmaple.com:80/
${aspnet-request-url:IncludePort=false} - produces http://www.exmaple.com/
${aspnet-request-url:IncludeScheme=false} - produces www.exmaple.com/
${aspnet-request-url:IncludePort=true:IncludeQueryString=true} - produces http://www.exmaple.com:80/?t=1
${aspnet-request-useragent} - Produces - User Agent String from the Request.
${aspnet-request:item=v}
${aspnet-request:querystring=v}
${aspnet-request:form=v}
${aspnet-request:cookie=v}
${aspnet-request:header=h}
${aspnet-request:serverVariable=v}
${aspnet-response-statuscode} - Produces - 200.
${aspnet-session:variable=myvariable} - produces "123"
${aspnet-session:variable=anothervariable} - produces "01/01/2006 00:00:00"
${aspnet-session:variable=anothervariable:culture=pl-PL} - produces "2006-01-01 00:00:00"
${aspnet-session:variable=myvariable:padding=5} - produces " 123"
${aspnet-session:variable=myvariable:padding=-5} - produces "123 "
${aspnet-session:variable=stringvariable:upperCase=true} - produces "AAA BBB"
${longdate}|${level:uppercase=true}|${logger}|${message}
Typically this target is used in cooperation with PostFilteringTargetWrapper to provide verbose logging for failing requests and normal or no logging for successful requests. We need to make the decision of the final filtering rule to apply after all logs for a page have been generated.
To use this target, you need to add an entry in the httpModules section of web.config:
]]>
To set up the ASP.NET Buffering target wrapper configuration file, put
the following in
This assumes just one target and a single rule. More configuration options are described here.
To configure the target programmatically, put the following
piece of code in your
Fully working C# project can be found in the