'Where to Log application info when the application is deployed to Azure
Hi I am new to this but previously, I was using Log4Net successfully to log info and errors. Now when we are migrating to the cloud and hosting the app in Azure. Where should I store the the files. Currently the root folder is C:\Log\LogfileFortheapp.txt.
Not sure can I create a folder within the solution and store the files there? If so how I give a path in the web.Config file?
Also if I could Azure logs, it seems there are too many tools. But for the moment I need to use one which can store the error or information that I am currently logging into Log4net. So any suggestion please?
Solution 1:[1]
Where to Log application info when the application is deployed to Azure
Refer Capture Web Application Logs with App Service Diagnostics Logging
- You can use Kudu to view the logs : https://.scm.azurewebsites.net/DebugConsole
- With the new Azure Monitor integration, you can create
Diagnostic Settings
to send logs toStorage Accounts
,Event Hubs
andLog Analytics
. - You can also check App Service diagnostics from Azure Portal for pointers.
- To access App Service diagnostics,
- Azure Portal =>your App Service =>In the left navigation, click on Diagnose and solve problems – Checkout the tile for “Diagnostic Tools” and “Availability and Performance” > "Application Logs" title.
Not sure can I create a folder within the solution and store the files there? If so how I give a path in the web.Config file?
Configure the log4net name, type properties in the web.config
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/>
</configSections>
</configuration>
- You should create the Log4Net folder.
Navigate to the Kudu console : https://.scm.azurewebsites.net/DebugConsole and create a new folder
Please refer configure log4net on Azure App Service and Using log4net for more information
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | HarshithaVeeramalla-MT |