Umbraco LogViewer Error Troobleshooting

Learn how to resolve typical Umbraco LogViewer errors that prevent you from viewing critical system events.

LogViewer is a place that every Umbraco developer visits regularly.

It's where we diagnose issues and analyze all important events in the system. 

However, sometimes the LogViewer in the Umbraco backoffice stops functioning, leaving administrators with cryptic messages such as:

  • Server error: Contact administrator, see log for full details.
  • Failed to retrieve log level counts.
  • Failed to retrieve number of errors in logs.
  • Failed to retrieve log templates.

Here is a screenshot from the Umbraco panel:

Umbraco 13 LogViewer Error in the backoffice

Umbraco 13 LogViewer Error in the backoffice

Server error: Contact administrator, see log for full details. Failed to retrieve log level counts
Server error: Contact administrator, see log for full details. Failed to retrieve number of errors in logs
Server error: Contact administrator, see log for full details. Failed to retrieve log templates

When this happens, it's nearly impossible to analyze system activity.

Our team encountered this issue sporadically during deployments on test environments when working with Umbraco 13.5.0.

After every deployment, the LogViewer would stop working until corrective actions were taken.

If you're facing similar issues, here are four ways to resolve them.

Solution 1: Remove Existing Log Files

The quickest fix often involves removing the existing log files stored in the default directory (umbraco/Logs) and restarting the application.

This method clears potential conflicts or corruption in the log files.

Steps:

  1. Navigate to the log directory (default: ~/umbraco/Logs).
  2. Delete all UmbracoTraceLog.*.json files.
  3. Restart the application.

TIP:

If your application is hosted on Azure, you can use the Kudu console to access and delete these files directly:

  • Go to your App Service in Azure.
  • Open the Advanced Tools (Kudu).
  • Navigate to the LogFiles directory and delete the relevant files.

However, this solution might not always be feasible, especially if a running process locks the files, preventing deletion.

In such cases, consider other approaches.

Solution 2: Change the Logging Directory

If removing logs isn't an option or doesn't work, you can temporarily change the logging directory.

Umbraco allows you to configure the log location via the appsettings.json file.

Configuration Example:

"Umbraco": {
    "CMS": {
      "Logging": {
        "Directory": "~/umbraco/Logs2"
      }
  }

If you set the configuration this way, the logs will be saved in the custom "Logs2" directory.

Umbraco custom logging directory

Umbraco custom logging directory 'Logs2'

Steps:

  1. Update the logging path in the appsettings.json file.
  2. Restart the application.

While this workaround often resolves the issue, it’s not a permanent fix.

If the underlying issue persists, you may need to repeat the process or escalate to other methods.

Solution 3: Scale Up the Application

In some cases, scaling up your application to a higher plan temporarily resolves the issue.

This solution is particularly relevant for Azure-hosted apps, where resource contention might cause logging issues.

Steps:

  1. Open the Azure portal.
  2. Navigate to your App Service.
  3. Increase the plan to a higher pricing tier.
  4. Restart the application.

Scaling up not only resolves the logging problem but may also improve the overall performance of your application.

Solution 4: Upgrade to the Latest Version of Umbraco

Sometimes, the root cause of a problem is a bug in the version of Umbraco you're using.

Upgrading to the latest version may resolve these issues permanently.

Steps:

  1. Check the release notes for the latest Umbraco version to confirm if a fix is included.
  2. Plan and perform an upgrade of your Umbraco instance.

TIP:

Always test the upgrade process in a staging environment before applying it to production.

Important Note: If You’re Using Umbraco 10+

If your project runs on Umbraco 10 or newer, it’s crucial to be aware of potential challenges with these versions. Check out these key blog posts for insights into significant issues and updates:

Staying informed can save you time and effort when troubleshooting or upgrading. Don't skip these essential reads! 🚀

Key Takeaways

LogViewer issues in Umbraco can disrupt your ability to monitor system health and diagnose errors.

By following these methods, you can try to resolve the issue:

  1. Remove existing log files.
  2. Remove corrupted lines from malformed JSON.
  3. Change the logging directory.
  4. Scale up your application.
  5. Upgrade to the latest version of Umbraco.

Each approach offers unique advantages, so try them in sequence to find the best one for your setup.

What's Next?

Explore our blog for more insights, and feel free to reach out for any queries or discussions related to Umbraco development.

↑ Top ↑