Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Carl Jackson 139 posts 478 karma points
    May 20, 2015 @ 18:20
    Carl Jackson
    0

    log4net configuration file virtual directory

    Hi.

    I have spotted an issue when deploying to a server and setting up App_Data as a virtual directory, even with correct permissions it will not write the log file.

    If you give write permission to the site root Umbraco duplicates the App_Data folder and creates the log folder inside it!

    The file location in the config file is ...

    <file value="App_Data\Logs\UmbracoTraceLog.txt" />
    

    and I think it should really be more like...

    <file value="~\App_Data\Logs\UmbracoTraceLog.txt" />
    

    However this creates the "~" directory

    Any thoughts on how to get the log to write to a virtual directory on IIS?

    Thanks

    Carl

  • Kieron McIntyre 117 posts 360 karma points
    Jul 27, 2015 @ 10:23
    Kieron McIntyre
    0

    I have the same issue and I'm fairly sure this is because regardless of the value being specified, log4net is converting the value to a physical path so ignoring the virtual directory.

    The only way I know of is to specify the physical path to the app_data folder. Not ideal but prevents the duplication.

  • Carl Jackson 139 posts 478 karma points
    Aug 06, 2015 @ 12:27
    Carl Jackson
    0

    Hi Kieron,

    I have the same issue with a Umbraco form "umbracolicencinglog.txt" not liking virtual directories too.

    My current solution is to have my ms build deployment create the app_data folder and assign permissions to allow writing to it.

    If the virtual directory is setup prior to this then that takes priority over everything apart from the logs which are all that is written to that location.

    This is more fail safe, a possible better solution I think is to do the same but with a specific "logs" folder and change the config so it writes logs to that location.

    The only problem then is the licensing log for forms, if that uses log4net too or if there is a config for where it writes. If not the app_data folder would still need to be writable.

    Thanks

    Carl.

Please Sign in or register to post replies

Write your reply to:

Draft