Code Coverage by Clover.NET

 « Return to Thread: Custom XML log file

Custom XML log file

by Eniac :: Rate this Message:

Reply to Author | View in Thread

Hi,

I've downloaded and installed NLog.

Now im playing around with it, trying to get a customized format for my XML log and i find myself unable to do anything, anything useful for my application anyway.

I've tried the log4jxmlevent renderer and it works fine but not completely. it doesn't render proper xml file since its missing header and footer.

I've tried to make some combination with LayoutWithHeaderAndFooter but i cannot make any kind of sense on how to use it.

I've thought of creating my own renderer, which would work out fine i think, but i woud still need to make it work with LayoutWithHeaderAndFooter.

Now, im trying to instantiate the Header and footer thing and do it programatically but apparently i need classes that implements ilayout. when i try to create my own, i have no idea what kind of work the methods are supposed to accomplish.

all i really wanna do is something like this :

Dim myLayout as New myCustomRenderer()

dim myHeaderAndFooter as new NLog.LayoutWithHeaderAndFooter
myHeaderAndFooter.Header = "<?xml version="""1.0""" ?>" & vbcrlf & vbtab & "<errors>"
myHeaderAndFooter.Footer = vbtab & "</errors>"
myHeaderAndFooter.Layout = myLayout


**
but i know its not possible, can please someone point me in the right direction ? im really having problem finding documention on the matter.

 « Return to Thread: Custom XML log file

LightInTheBox - Buy quality products at wholesale price