Where to place and secure log

Discussion in 'Getting started' started by OLTernative, Mar 8, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,

    When I was developing my application, I used log4net for logging and had it set to write to "C:\AppLogs\Log.txt" . This worked fine. However, what should I now set it to on the DASP server, and how can I ensure that it is not viewable by anyone but me?

    Thanks
     
  2. Hi,
    The _database folder that came with your site originally is safe for this.
    You can use that folder for files like PDF also, it works great.
    All the best,
    Mark
     
  3. Hi Mark,
    Thanks for the reply! Just a quick question. I've disabled browsing the _database (or any other) directory in my IIS, so the 'forbidden' message comes up. I've tried to handle the 403 error in my web.config, but it doesn't seem to redirect and the standard IIS page is still shown. Have I missed something?

    Thanks for the help
     
  4. ...Right now I'm hoping Bruce will have a good tip for you. ;-)
    If I think of anything I'll re-post.
    All the best,
    Mark
     
  5. lol, no worries, thanks for the help :)
     
  6. Bruce

    Bruce DiscountASP.NET Staff

    Can you get us more details? eg. what platform? iis6 or 7?

    how did you set up the custom error?
     
  7. Hi Bruce,

    I'm using IIS 7, Windows Server 2008. My web.config file is set up as below.

    PHP:
    <customErrors mode="On" defaultRedirect="~/Error/Error.aspx" >
                <
    error statusCode="404" redirect="~/Error/NotFound.aspx"/>
                <
    error statusCode="403" redirect="~/Error/NotFound.aspx"/>
            </
    customErrors>
    If I try and access a page that doesn't exist, it redirects to the correct 'NotFound' page. If an error bubbles up, it gets redirected to the Error page. These are fine. However, if I try and access a directory that doesn't exist, I get a generic 404.0 - Not Found page and I get a generic 403.14 - Forbidden page if the directory does exist but is out of bounds.

    Any ideas what I'm doing wrong?
    thanks
     
  8. Bruce

    Bruce DiscountASP.NET Staff

    this looks like the asp.net custom error.

    note that there's another custom error associated with IIS. Use the IIS manager to configure this.
     
  9. Both textboxes in the Custom Error section of IIS are blank. It says that that section is only for non-asp.net pages, so I left it blank as all of my pages are .aspx.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page