Unable to Correctly Register Layout Renderer

31 views
Skip to first unread message

Peter Doro

unread,
Jul 24, 2019, 1:46:57 PM7/24/19
to NLog-Users
I am new to using NLog and I am trying to implement a custom layout renderer that indents based on stack depth. Currently I am using the layout from here: https://stackoverflow.com/questions/5951102/nlog-custom-layoutrenderer-for-scope-indentation

So like: 
Method A calls:
Method B which calls:
Method C end

Method D calls:
Method E end 

I have put the code from that post inside of a class in my project and I placing this in my code before logging begins: LayoutRenderer.Register("IndentationLayout", typeof(IndentationLayoutRenderer)); 

That seems to be the way everyone is implementing it, but when I check the internal logs it seems to never even recognize the layout and just goes to default. Anyone have any ideas? 

Thanks
 
Reply all
Reply to author
Forward
0 new messages