Copied to clipboard

Flag this post as spam?

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

  • Chuck Kirklen 32 posts 167 karma points
    May 17, 2018 @ 00:06
    Chuck Kirklen

    Umbraco 7.7.6 not writing/creating new log files

    Copied site and SQL from local machine to hosting environment where we have lots of other Umbraco 7 sites. At some point, the shared hosting version stopped logging to App_Data/Logs and won't create log files.

    Site and back office both working fine, just no logs on the hosted version. I can see entries in the umbracoLog table, but the physical log file isn't happening anymore on the shared server. Works just fine on local machine.

    Everything is identical in the bin folders, views, App_Code, etc., etc., web.config (except for DB connection), and config/log4net.config, and all the other /config files, for that matter.

    Even brought a copy of the DB down from hosting to local and attached it, and logging works on local but not on hosting.

    On the hosting site, renamed the TEMP folder and Umbraco recreated it just fine. But if i rename the Logs folder, a new one is not created. If i restore the Logs folder, no individual log files are written to or created.

    What is the most likely culprit for this? Short of a fresh re-copy of everything in the file system, any ideas?

    Thanks in advance...

  • Nadine Fisch 118 posts 332 karma points
    May 17, 2018 @ 06:27
    Nadine Fisch

    did you check the read/write permission on the folder/files?

  • Chuck Kirklen 32 posts 167 karma points
    May 17, 2018 @ 14:21
    Chuck Kirklen

    Yup - full permissions on the entire file structure. Logging was working just fine and just stopped one day - the last entries were missing the timestamp in front of the log entries, which led me to think something had fallen over in Log4Net, but the bin folder is a complete match and the config files in /config as well.

  • Dan Diplo 1316 posts 4880 karma points MVP 2x c-trib
    May 17, 2018 @ 14:53
    Dan Diplo

    Why don't you look in the log files to see what the error is? :)

    But, seriously, you have double checked that /config/log4net.config has no errors in it? Maybe copy over a version from a clean install?

    You can perform a file system permissions health check in the Umbraco backend, so I'd run that just to double check write permission is OK.

  • Chuck Kirklen 32 posts 167 karma points
    May 17, 2018 @ 16:55
    Chuck Kirklen

    Health check on the shared server passed with flying green checkmarks everywhere (including permissions). The only non-green checkmark was for not being SSL, since we're waiting on the cert to be issued.

    But the site is running plain old http both locally and on the shared server, so the SSL test isn't worrysome at this point.

    Copied over the log4net DLLs and log4net.config from working local version (which show to be identical to the ones on the server), but still no logs on the server.

    Have enabled IIS logging at the hosting site but not seeing anything pop up in there beside normal page requests as i navigate through the back office and the site.

    Agree it feels like a permissions thing, but everything is checking out as matching between local and server.

  • Nadine Fisch 118 posts 332 karma points
    May 17, 2018 @ 19:11
    Nadine Fisch

    It still sounds for me like a permission or a "path" error. I had a similar case and I need to set the correct permission on the "parent"-folder. Like in your case AppData? Maybe you need a special User to have the correct permission?

    I found an interesting page about the necessary Permissions:

    Another try:

    Is the url of the log file set correctly? (wwwroot/config/log4net.config)

    <file type="log4net.Util.PatternString" value="App_Data\Logs`\UmbracoTraceLog.%property{log4net:HostName}.txt" />`

    Please also check the " IIS Application Pool Identity" permissions. See here

    "The main point to understand is that the IIS Application Pool Identity (e.g. local.installingUmbracoDemo) requires sufficient permissions to be able to MODIFY, READ and WRITE certain files in your Umbraco installation instance.

    For local development (which is what we are doing) I always assign FULL CONTROL to the IUSR & IIS_IUSRS User Groups so that they have permission to MODIFY, READ & EXECUTE, LIST FOLDER CONTENTS, READ & WRITE. Using this approach helps to overcome any permission related issues during the installation process of Umbraco. "

  • Chuck Kirklen 32 posts 167 karma points
    May 23, 2018 @ 16:13
    Chuck Kirklen

    Aha! Solved. In the cloud hosting environment we are running, it seems the hostname changes on occasion when the instance gets spun up after being dormant. Didn't have anything to do with permissions.

    In log4net.config, here's where the file gets named:

    <file type="log4net.Util.PatternString" value="App_Data\Logs\UmbracoTraceLog.%property{log4net:HostName}.txt" />

    For some reason, on some sites we would see logfiles change names along the way as they would be opened and closed, but on some sites, we'd stop seeing new entries but never see a new log file created. Recycling the site and the app pool wasn't resolving the issue.

    So I changed the config to remove the host name, and - voila! - a new log file got created instantly and is being updated.

    <file type="log4net.Util.PatternString" value="App_Data\Logs\UmbracoTraceLog.txt" />

    This just felt like something that had to do with the environment we were in; and one change in Umbraco 7 was to include the host name in the log4net naming convention.

    So wherever log4net gets the hostname from, I'm guessing there was confusion when the site would get spun up somewhere new. Removing that variable seemed to solve the problem.

Please Sign in or register to post replies

Write your reply to: