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:

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

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.

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

Leave a Reply

Recent Posts




All Rights Reserved Theme by 404 THEME.