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 

Filed under: C#