I currently write all log4net events to a database, and it seems to work just fine. To capture the logged in user account I use this piece of code:
HttpConte
I've used the solution of wageoghe and Gian Marco Gherardi, but rather than GlobalContext have set the thread context immediatley before logging the message:
ThreadContext.Properties["user"] = new HttpContextUserNameProvider();