cancel
Showing results for 
Search instead for 
Did you mean: 

Unity API Exception Logs

Ryan_Wilson2
Star Contributor
Star Contributor

Where are the Exception logs stored for the Unity API and how do I retrieve or view them?

1 ACCEPTED ANSWER

Devanshu_Upadh1
Champ in-the-making
Champ in-the-making

Ryan,

You can use the application object of unity script and write logs to the diagnostic console, all messages will appear in the Unity Messages tab- (screenshot from the sdk, link - https://sdk.onbase.com/unitySDK/html/b936d80a-4dc4-426f-be4a-59440b61d4fb.htm)

44531271b96d4b1dbc5bb7265b79d384

Code sample -

app.Diagnostics.Write("My log");

app.Diagnostics.WriteIf(Diagnostics.DiagnosticsLevel.Error, "This is an error Message")

Or you can use open source .NET logging frameworks like Serilog (dll import required) and write to text files

link - https://serilog.net/

 

View answer in original post

2 REPLIES 2

Devanshu_Upadh1
Champ in-the-making
Champ in-the-making

Ryan,

You can use the application object of unity script and write logs to the diagnostic console, all messages will appear in the Unity Messages tab- (screenshot from the sdk, link - https://sdk.onbase.com/unitySDK/html/b936d80a-4dc4-426f-be4a-59440b61d4fb.htm)

44531271b96d4b1dbc5bb7265b79d384

Code sample -

app.Diagnostics.Write("My log");

app.Diagnostics.WriteIf(Diagnostics.DiagnosticsLevel.Error, "This is an error Message")

Or you can use open source .NET logging frameworks like Serilog (dll import required) and write to text files

link - https://serilog.net/

 

If your messages don't appear in the Diagnostic Console, you may need to turn on the Unity mail slot in your web.config on the Application Server.  There is a WAMCON GUI utility to turn on/off each tab of the Diagnostic Console. Warning: When you save the new settings, it will disconnect any current connections to that Application Server.   If you haven't used that before, see the WebAppConsole MRG for more details.

Cheers.