What does custom property %property{jobType} or job[%property{jobType}] do to a Log4Net Filename?

Log4Net allows you to customize your output files with various parameters.

For example:

<pre>
<conversionPattern value="%property{logLocation}\Logs\MyProgram.log.%date{yyyyMMdd-HHmm} processid[%processid]  job[%property{jobType}].txt" />
</pre>

It will show something like “job[LoadJob]” or “job[Whatever] based on your custom property called “jobType”.

This is a custom property which is set as follows.

<pre>
GlobalContext.Properties["jobType"] = currentProcessorType;  // or some literal value 
</pre>

Uncategorized  

Leave a Reply