views:

44

answers:

1

I had Log4Net working on my Local machine. It logged to a DB with one FileAppender, Nothing logged to a file. When I moved my code to my shared Hoting provider (GoDaddy) I got an exception about FileIOPermission required. Does anyone have any ideas of what might have been happening?

I removed the configuration and am at the moment using ELMAH to log everything, (although I would like to use Log4Net) so I don't have any of the examples or stack traces anymore.

Any thoughts would be appreciated.

A: 

This is not much info to work with, but here are a few things you can do:

  1. You can always debug the actual log4net code.
  2. When it doesn't write to a file, it's usually a problem of permissions. If it's a web project, look at what user the application pool is running under (usually LOCAL SYSTEM), and that user needs write access to the file (and the directory where you want to put the file). The fact that the exception is actually FileIOPermission required definitely points to this direction.
  3. Similarly, it might be that there is a temp file that log4net is trying to use when you're logging to a db. In that case, you might going to have to change your temp folder.

Furthermore, look at this post: http://stackoverflow.com/questions/3542581/log4net-works-on-dev-machine-fails-when-deployed-to-shared-host-using-same-db-c

Gyuri
I left the internal debugging writing to a file from when I was trying to debug on my dev machine... lame :) thanks for the temp file check it made me think of what might have been going wrong.
EJC