Guide 2: Server errors and logs


Introduction to errors
Someties your server can work wrong, or throw errors. You can see them in your console or in logs.

As usual when error happens in plugin it looks like this:
Failed to run a 1.00 timer in 'Test v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.Test.C () [0x00008] in <e06c732a9d424a54869ff22c823cb5b7>:0
  at Oxide.Plugins.Test.B () [0x00000] in <e06c732a9d424a54869ff22c823cb5b7>:0                        0b/s in, 0b/s out
  at Oxide.Plugins.Test.A () [0x00000] in <e06c732a9d424a54869ff22c823cb5b7>:0
  at Oxide.Core.Libraries.Timer+TimerInstance.FireCallback () [0x00018] in <ec05e0208c9149bba43236ca58fea105>:0

Lines explanation:
  1. Error description and plugin name + plugin version
  2. Method with error
  3. Next lines are path from where exactly error happened
But sometimes your error can look just like that:
Nullreferenceexception: objectreference not set to an instance of an object
Not very clear right? That means error hapenned in something realted to unity, but full information we can find only in logs

Where to find logs
There are various types of logs, but you need specific one. To enable it you need to add to your startup options
-logfile Log.txt
If you are running server at hosting it can be enabled by default. As usual its located in root plugin folder nad called something like "Log.txt", "Last.txt" or something like that. Its starting with following lines:
Mono path[0] = 'C:/RustServer/RustDedicated_Data/Managed'
Mono config path = 'C:/RustServer/MonoBleedingEdge/etc'
Initialize engine version: 2019.4.7f1 (e992b1a16e65)
[Subsystems] Discovering subsystems at path C:/RustServer/RustDedicated_Data/UnitySubsystems
Forcing GfxDevice: Null
GfxDevice: creating device client; threaded=0
    Version:  NULL 1.0 [1.0]
    Renderer: Null Device
    Vendor:   Unity Technologies
Begin MonoManager ReloadAssembly
- Completed reload, in  3.240 seconds
Microsoft Media Foundation video decoding to texture disabled: graphics device is Null, only Direct3D 11 and Direct3D 12 (only on desktop) are supported.
Shader 'TextMeshPro/Distance Field': fallback shader 'TextMeshPro/Mobile/Distance Field' not found
UnloadTime: 4.202100 ms
3D Noise requires higher shader capabilities (Shader Model 3.5 / OpenGL ES 3.0), which are not available on the current platform: graphicsShaderLevel (current/required) = 30 / 35
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

also every few lines it will contain
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
so you will be sure its right file. Then you just press CTRL+F and type there error you saw in console and there you will see full log.
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

NullReferenceException: Object reference not set to an instance of an object
  at Oxide.Plugins.Test+TestScript.Throw () [0x00008] in <719d508368554d85bde7a90c62901a32>:0

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
There you can see same if it was happening from plugin or whatever

Simple way
If you are lazy or you don't understand what to do - there are simple way. You can install special plugin Plugin: Errors Logger that will make part of that work for you, and save logs in special folders. It also can send direct logs to plugin developers!
Last edited: