NLog interception, NLog live events via Asp.net page

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NLog interception, NLog live events via Asp.net page

z4711
Intention, idea:
supervision of my 'asp.net 4 web app' from anywhere
web page showing all NLog events (older events from files, actual events by intercept NLog),

Conception:
custom target to intercept live/brand new events,
events stored in file per day (XML format)

Config:
  <targets>
    <target name="i"
            type="Interceptor"/>
    <target name="x"
            xsi:type="File"
            fileName="${basedir}/logs/${shortdate}.xml"
            layout="${log4jxmlevent:includeCallSite=true:includeNLogData=true}" />
  </targets>
  <rules>
    <logger name="*" minLevel="Trace" writeTo="i"/>
    <logger name="*" minlevel="Trace" writeTo="x" />
  </rules>

1. question: <nlog:eventSequenceNumber> appears only if  target layout contains 'includeCallSite=true:includeNLogData=true',     why?

2. question: is there a more efficient way to store and reread (old) events rather than XML resp. log4jxml?

3. question: is there a c# class/parser for log4jxml events files?
Reply | Threaded
Open this post in threaded view
|

Re: NLog interception, NLog live events via Asp.net page

z4711
1 . Imagine we would have a binary RAW file format for storing events (without any formatting, pure event data only)

2 . Imagine we could read the RAW events files back to NLog and recycle them trough the existing engine (using targets and layouts as usual), producing the formats we want.