This is not directly possible with NLog but there are at least two methods you can use:
1. Create a new layout renderer which reads from a file. Something like:
${filecontents:filename=file.txt}
and use this to read the contents of the trace file.
2. I'm not sure, but it looks like the new PostFilteringWrapper available in the latest snapshots may be what you want:
http://www.nabble.com/New-NLog-features-t449777c6167.htmlYou can basically buffer all your messages in memory and send them down to the specified target as soon as any condition is met. For example you can:
a) buffer the entire ASP.NET request in memory
b) as soon as the request finishes, check the buffer contents:
i) if it contains any >= Warn message - dump the buffer contents including any messages at the Debug level and above
ii) if it contains any >= Error message - dump the buffer contents including any messages at the Trace level and above
iii) otherwise just output the Info level and above messages
Hope it helps,
Jarek