How to find logs
- 2 minutes to read
How can you find a root cause of an error? In the best-case scenario, it is shown in the Developer Tools Console or right in the editor's IFRAME where Design Editor is supposed to be loaded.
If you are not sure what is causing the error, you need to find out where it is occurring: on the client or on the server side.
- Open the Developer Tools (press F12).
- Reproduce the error.
- Switch to the Network tab.
If there is a failed HTTP request (it should be highlighted in red with a 50x code, like 500, 502, etc.), then the error is occurring on the server side. Otherwise, it is occurring on the client side, and it is most likely a JavaScript error.
To analyze the server side error, select the failed request on the Network tab and then switch to the Response (Preview) tab. The response contains either a descriptive message or a text like "An error has occurred". In the latter case, you should analyze logs on your server. Design Editor provides two types of such logs:
- A text file logged by NLog. You can find it in the ~\Resources\Logs\All.log file.
- XML files logged by Elmah. They are ~\Resources\Logs\*.xml.
If you face an error while integrating or debugging Design Editor, check the Elmah's files first. Consider the All.log file as an auxiliary, you can refer to it if you think that Elmah does not include some messages or the logs it saves are too complicated.
If an error occurs while running Design Editor, both of these logs can be useful for our support team.
You can get the Elmah's logs through a web interface. Usually, the Elmah's interface is available only on your server, so do the following to check them:
- Log in to the server through RDP.
- Type <editor_url>/elmah.axd in your browser address bar. Here, <editor_url> is a URL of the Design Editor with the
localhost
domain. For example,localhost:65001/Users/6F96A9FF-8B86-D011-B42D-00CF424964FF/SimplePolygraphy/Elmah.axd
.
If you find it difficult to log in through RDP every time, you can get web access to the interface as Elmah wiki describes. To enable web access, set the allowRemoteAccess
attribute to true
in the web.config file.
<configuration>
<elmah>
<security allowRemoteAccess="true" />
</elmah>
</configuration>
Note
Allowing the remote access to your server is not secure, so it is recommended only for development computers.
Also, you can set up your site so that it provides detailed ASP.NET errors - not just "An error has occurred" - to both your local host and remote clients. To perform this, set the mode
attribute of customErrors to "Off"
in web.config. By default, this attribute is RemoteOnly
and shows custom errors to the remote clients and ASP.NET errors to the local host only.
<configuration>
<system.web>
<customErrors mode="Off" />
</system.web>
</configuration>
Note
Providing ASP.NET errors to remote clients can be insecure, so it is recommended only for debugging purposes.