Overview
stdout logs are essential for diagnosing .NET Core and Blazor application issues. This guide shows you how to enable, locate, and read these logs in Plesk Windows hosting.
Enabling stdout Logging
stdout logging must be enabled in your web.config file:
Step 1: Edit web.config
- In Plesk, go to Files
- Navigate to httpdocs
- Edit web.config
Step 2: Enable Logging
Find the aspNetCore element and update it:
<aspNetCore processPath="dotnet"
arguments=".YourApp.dll"
stdoutLogEnabled="true"
stdoutLogFile=".logsstdout"
hostingModel="inprocess">
</aspNetCore>
Step 3: Create Logs Folder
- In Plesk Files, navigate to httpdocs
- Create a new folder named logs
- Ensure the folder has write permissions
Locating Log Files
After enabling, logs appear in:
httpdocs/logs/stdout_YYYYMMDDHHMMSS_PID.log
Each application start creates a new log file.
Reading Logs in Plesk
- Go to Files in Plesk
- Navigate to httpdocs/logs
- Click on the most recent log file
- Click Edit in Text Editor or download the file
Understanding Log Content
stdout logs contain:
- Startup messages - Application initialization
- Exception details - Full stack traces
- Configuration errors - Missing settings, connection issues
- Request information - If logging middleware is configured
Example Log Output
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
fail: Microsoft.EntityFrameworkCore.Database.Connection[20004]
An error occurred using the connection to database 'mydb'.
System.Data.SqlClient.SqlException: Login failed for user 'myuser'.
Common Issues Found in Logs
Missing Dependencies
System.IO.FileNotFoundException: Could not load file or assembly 'SomePackage'
Solution: Republish with all dependencies or use self-contained deployment.
Database Connection Errors
SqlException: A network-related or instance-specific error
Solution: Verify connection string and database server accessibility.
Configuration Errors
InvalidOperationException: Unable to resolve service for type
Solution: Check dependency injection configuration in Program.cs.
Production Considerations
- Disable stdout logging in production after debugging (
stdoutLogEnabled="false") - Log files grow indefinitely - periodically clean old logs
- Consider using structured logging (Serilog, NLog) for production
Alternative: Application Insights
For production monitoring, consider Azure Application Insights integration for advanced logging and diagnostics.