How to view console logs in Umbraco Cloud?
# help-with-umbraco
t
We have a simple site with razor templates, and one of the razor templates calls
Console.WriteLine
in C# code. This is seen in local development in the output of the
dotnet run
or equivalent. How can we view this output in an Umbraco Cloud context? We've checked Server logs, it's not there. We've also tried connecting with curl to the logstream found in kudu, but nothing shows up there either.
m
console logs aren't written by default in production.. you'd need to add into `appsettings.production.config`and even then not sure where you would go to view them https://docs.umbraco.com/umbraco-cms/reference/configuration/serilog#logging-to-a-different-output I think for production you'd be better writing to the ILogger, and maybe even to a remote serilog sink, (SEQ is our preferred) ?? https://docs.umbraco.com/umbraco-cms/fundamentals/code/debugging/logging#writing-to-the-log ps you can inject the logger directly into a razor template off the top of my head something like..
Copy code
csharp
using Microsoft.Extensions.Logging;
@inject Ilogger<UmbracoViewPage> _logger
t
Thanks for the tips Mike!
5 Views