Tag Archives: Log4Net

log4net – another way to change log file location on runtime

In my previous post I wrote about the simplest way of specifying logging location, which limited the solution only to environment variables set on a particular machine. However if you wanted to expand on all types of special folders available in Windows then we will have to look for a different solution, fortunately support for that is also available within log4net.

Difficulty level of this solution is a bit high, but it provides nearly 60 locations to choose from, as it uses “Environment.SpecialFolder” enumeration.

Continue reading

log4net – changing log file location on runtime

In one of our application we are using apache log4net, initially we were logging to the “logs” folder, which was located in the application installation folder. When we were testing this application on different Windows operating systems, it was not generating logs when we ran our application under least privileges account.

Where should we log then?

Continue reading