Nodejs App Service unable to stream console log to log analytics

Shao 0 Reputation points
2024-11-28T08:01:48.13+00:00

The current way of storing log is using a Logic App to download log files in Kudo Console periodically. However this method has flaws when there is spike in request Kudo Console can only keep a certain number of file and the new file will be overwritten. So in certain cases we will have missing log.

First trial: App Service Logs

User's image I enabled config with these settings. Our expectation is the log file will be save to blob storage automatically without losing any file. However the file I get from the 'App Service Logs' doesnt resemble any console log, it looks more like the web server log
User's image

Second Trial: Diagnostic Setting

User's image User's image

however there is no container for console logs.

Visiting the 'Logs' under 'Monitoring' I cant get any result for 'AppServiceConsoleLogs'

User's image

But 'AppServiceHTTPLogs' works just fine.

User's image Question 1: How can i stream the console logs to work just like httplogs?

The alternative is I tried to send console logs using npm library for application insight to auto collect console logs.

User's image However if involves multiple app service we are unable to differentiate the source of the logs.

Question 2: What are the best practice if we setup the logs through app insight sdk? 1 app 1 app insight?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,056 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.