I have a database I’m trying to write my messages to and would like to use the ${level} layout, but I need to translate it to the int value for reference to my own table that stores logging levels. Is it possible to maybe cast the level to my enum in config? Any other ideas?
Share
I have not checked this, but I suspect you should be able to just write your own layout renderer (plugin) for NLog to do what you want to do. NLog is very pluggable 🙂
A quick example of how a layout renderer could look (not tested…):