Copied to clipboard

Flag this post as spam?

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


  • Simone Chiaretta 134 posts 541 karma points c-trib
    May 12, 2022 @ 08:01
    Simone Chiaretta
    0

    Installing Umbraco v9 on Azure: change log file location

    Dears, we are installing Umbraco v9 to azure using az webapp deploy (which uses the Kudu zip deploy API endpoint underneath). We setup the config as recommended for azure, with the EnvironmentTemp setting, and that takes care of everything that is under Data/Temp.

    But every time we deploy a new version, the Log folder gets deleted.

    Is it possible to change the location of log files, or write to a storage account or exclude them from the "cleanup" of the current folder during deployment?

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    May 12, 2022 @ 10:42
    Nik
    1

    Hey Simone,

    You can install the Serilog.Sinks.AzureBlobStorage nuget package and configure a second serilog sync to log to blob storage. However, the logs that are put there can't be viewed by the Umbraco back office, but it does work as a good secondary source of logs.

    Once you've installed the nuget package, there are a few settings needed in the appsettings.json to get it to work, but it's pretty quick to setup.

    This means that your Umbraco back office will show you the logs for your currently deployed site, but if you need historic you need to download the logs from blob storage and then use something like Compact log viewer to view them locally.

    Thanks

    Nik

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    May 12, 2022 @ 10:47
    Dave Woestenborghs
    100

    Hi Simone,

    All our websites in azure are loadbalanced, so that might be a different setup as you are using. But we often log to a sql server or other storage by using a different Serilog sink.

    But depending on what you are using you will need to create a custom logviewer implementation. See the docs about that : https://our.umbraco.com/Documentation/Fundamentals/Backoffice/LogViewer/#create-your-own-implementation

    Dave

  • Simone Chiaretta 134 posts 541 karma points c-trib
    May 12, 2022 @ 14:14
    Simone Chiaretta
    0

    Thanks Dave.

    We do have loadbalancing as well... this solution looks perfect!

Please Sign in or register to post replies

Write your reply to:

Draft