Log4Net database fields available for adoappender - it seems there are a few more ie method_name?

I recently created my simple log4net database table for logging through apponet appender .. and it works!

But then I notice another site using extra fields! Look!

Wow! I would like to know where I can get a list of available field names, for example Method_name really makes me think !!!

But registration usually supports adding to this field or do I need a wrapper or something like that? I see through the log4net configuration, which has the name of the method_name in the database field and has this

         "<conversionPattern value="%property{method_name}"/>"  

which is great, but how can I fill this out before calling the registrar?

I used standard thread, log, message and exception. Field Names ...

Does anyone have a recommendation or experience that I can register esle ... I would be great to be able to register a method name, I use the "LOGGER" field from GetType, which gives me a namespace and class ..

+3
source share
1 answer

Here is a list of all the different values โ€‹โ€‹that you can put in the transformation template .

It looks like you want to use the% method template:

<conversionPattern value="%method" />

You can also create custom properties and paste them into the log4net context.

log4net.ThreadContext.Properties["custom"] = "Custom Value";

<conversionPattern value="%property{custom}" />
+6
source

Source: https://habr.com/ru/post/1715931/


All Articles