You can inspect MDriven Turnkey and MDrivenServer diagnostic logs from a browser, the server file system, or Azure SCM when you need to investigate an error, startup problem, or unexpected server behavior.
Choose the log and access method
Both MDriven Turnkey and MDrivenServer write diagnostic output to a Logs folder beneath the application root. The default log4net configuration writes there; the IIS account that runs the application must have write access to that folder. If logging is missing, check that permission first.
| If you need to investigate | Start with | Typical location |
|---|---|---|
| An application error or exception in MDriven Turnkey | Turnkey error log | Logs/TurnkeyServerLogRollingERRORS.txt
|
| Detailed MDriven Turnkey activity | Turnkey debug log | Logs/TurnkeyServerRollingDEBUG.txt
|
| An MDrivenServer error or exception | MDrivenServer error log | Logs/MDrivenServerLogRollingERRORS.txt
|
| Detailed MDrivenServer activity, including server-side work | MDrivenServer debug log | Logs/MDrivenServerRollingDEBUG.txt
|
For example, if a Turnkey page reports an error, open TurnkeyServerLogRollingERRORS.txt first. If it does not explain the sequence that led to the error, open TurnkeyServerRollingDEBUG.txt and look at the entries immediately before the failure.
Open Turnkey logs in a browser
Replace <yourturnkey> with the base address of your Turnkey application. For example, if the application is hosted at https://contoso.azurewebsites.net, use that address in the URLs below.
Use the Portal links
If you manage the application through the MDriven Portal, open the application's manage page. It provides direct links to the Turnkey log pages.
Use the developer log pages
Use these pages when they are available on your Turnkey site:
https://<yourturnkey>/developer/errorshttps://<yourturnkey>/developer/log
If the server is not running in debug mode and you configured ShowDebugInfoPassword in Documentation:TurnkeySettings, include the password parameter:
https://<yourturnkey>/developer/log?password=<password>
Treat this password as a credential. Do not place a URL containing it in shared tickets, documentation, or browser history that other users can access.
Open the log files directly
The current Turnkey log files are also available at:
https://<yourturnkey>/logs/TurnkeyServerLogRollingERRORS.txthttps://<yourturnkey>/logs/TurnkeyServerRollingDEBUG.txt
Open MDrivenServer logs
When MDrivenServer is hosted under a Turnkey site, use the __MDrivenServer application path:
https://<yourturnkey>/__MDrivenServer/logs/MDrivenServerLogRollingERRORS.txthttps://<yourturnkey>/__MDrivenServer/logs/MDrivenServerRollingDEBUG.txt
You can also inspect logs from the MDrivenServer log UI. For server-side actions, the MDrivenServer administration log at admin/Log.aspx helps you follow related entries: entries from the same server job share a number even when several jobs run concurrently. See Documentation:Debugging MDrivenServer Serverside actions for how to use that information when debugging server-side work.
If an application appears paused or behaves unexpectedly, check the MDrivenServer administration area and the logs before changing configuration. Documentation:Turnkey App Current state: Paused describes where to check the model state.
Access logs through Azure SCM
For Azure-hosted applications, Azure provides an SCM administration site for each app:
https://<yourappname>.scm.azurewebsites.net
Sign in with credentials from the publishing profile, or with an account that has access to the Azure hosting subscription. You can retrieve the current debug logs through the SCM virtual file system API:
https://<yourappname>.scm.azurewebsites.net/api/vfs/site/wwwroot/logs/TurnkeyServerRollingDEBUG.txthttps://<yourappname>.scm.azurewebsites.net/api/vfs/site/wwwroot/__MDrivenServer/logs/MDrivenServerRollingDEBUG.txt
For example, use the first URL to retrieve the Turnkey debug log when the normal application URL is unavailable but the Azure SCM site remains accessible.
Read logs on the server
The current log is the file without an additional rolling extension. The log system renames older files and cleans them up, so do not assume that an older rolled file will remain indefinitely.
Windows and IIS
In a default IIS deployment, find the logs under the two application roots:
- MDrivenServer:
C:\inetpub\wwwroot\MDrivenServer\logs - MDriven Turnkey:
C:\inetpub\wwwroot\MDrivenTurnkey\logs
Use the actual site folders if you deployed the applications elsewhere. For IIS deployment requirements and other startup troubleshooting, see Documentation:Deploying MDriven Server & Turnkey Core on IIS.
To follow newly appended entries in PowerShell, change to the relevant Logs directory and run one of these commands:
Get-Content .\*ERRORS.txt -Wait -Tail 1
Get-Content .\*DEBUG.txt -Wait -Tail 1
Use the error command while reproducing an exception. Use the debug command when you need the surrounding activity as well.
Linux local installation
For the local installation layout, follow the active files with tail:
sudo tail -f /var/www/html/mdrivenserver/Logs/MDrivenServerRollingDEBUG.txt
sudo tail -f /var/www/html/mdrivenserver/Logs/MDrivenServerLogRollingERRORS.txt
sudo tail -f /var/www/html/mdriventurnkey/Logs/TurnkeyServerRollingDEBUG.txt
The paths above apply to the documented local installation layout. See HowTos:Local Installation for installation, service status, and local troubleshooting procedures.
When no log is written
If a URL returns no log, or the expected file is absent:
- Confirm that you are looking at the correct application: Turnkey logs are under the Turnkey root; MDrivenServer logs are under the MDrivenServer root or
__MDrivenServerpath. - Check whether the application can write to its
Logsdirectory. The account running the IIS application needs write access. - Check the application startup environment. On IIS, also inspect Event Viewer Application logs and IIS logs for startup failures.
- If the Turnkey diagnostic pages are unavailable, use the direct log-file URL, server file system, or Azure SCM access appropriate to the deployment.
- For application status and runtime information exposed by Turnkey, use Documentation:Serverinfo when debug information is enabled.
