-
-
Notifications
You must be signed in to change notification settings - Fork 305
Network Logging
Forge Networking has it's own logging system built in for the purposes of debugging and tracing any errors that may happen during network communication. When an exception is thrown on the networking layer, the logging system will pick that up and process the log. There are currently 2 main forms of logging that is built into the system, the in-game logging and the file system logging. We do not recommend using the in-game logging for any production environment, however we do suggest that you enable file logging for production environments.
The Forge Networking logger will only log network exceptions so it will not have any impact on performance, except if there are many exceptions being thrown (which shouldn't happen unless there is a critical process error in the game). This log does a little more than just log network exceptions however; it also logs exceptions that are thrown by your code during the network transport time. Things such as an invalid parameter to an RPC or an invalid cast being performed by your code. Because of this, we recommend always having this log available when testing your code in order to reduce support tickets on our end and in order to keep you as productive as possible towards your awesome product!
How To Enable Logging
- Navigate to
Bearded Man Studios Inc/Scripts/Logging/Resources/BMSLogger
- Having the BMSLogger selected, you can then check 'Log To File'
This will then allow you to log all exceptions and common networking debug logs into the logging folder (including logs that you write).
How to Enable Visible Logging
Note: This will allow you to see the logs in the build itself on any device.
- Navigate to
Bearded Man Studios Inc/Scripts/Logging/Resources/BMSLogger
- Having the BMSLogger selected, you can then check 'Logger Visible'
The final location of this log file will be dependent on whether it is in the editor or a build.
Editor location: Root Unity Directory/Assets/Logs/bmslog.txt
Windows Build Location: ExecutableDirectory/ExecutableName_Data/Logs/bmslog.txt
Using the Logger yourself for development purposes
BeardedManStudios.Forge.Logging.BMSLog.Log("ANYTHING YOU WANT TO LOGHERE!");
BeardedManStudios.Forge.Logging.BMSLog.LogFormat("FOLLOWING A FORMAT[{0}]", "ANYTHING YOU WANT TO LOG HERE!");
BeardedManStudios.Forge.Logging.BMSLog.LogWarning("ANYTHING YOU WANT TO LOGHERE!");
BeardedManStudios.Forge.Logging.BMSLog.LogWarningFormat("FOLLOWING A FORMAT[{0}]", "ANYTHING YOU WANT TO LOG HERE!");
BeardedManStudios.Forge.Logging.BMSLog.LogException([System.Exception]);
BeardedManStudios.Forge.Logging.BMSLog.LogException("ANYTHING YOU WANT TOLOG HERE!");
BeardedManStudios.Forge.Logging.BMSLog.LogExceptionFormat("FOLLOWING AFORMAT [{0}]", "ANYTHING YOU WANT TO LOG HERE!");
Above is code examples of how to call the logger to use it for logging purposes.
Note: All exceptions will automatically be logged, so put them in places that should never be called frequently, useful for testing on builds and figuring out what went wrong on the network.
Getting Started
Network Contract Wizard (NCW)
Remote Procedure Calls (RPCs)
Unity Integration
Basic Network Samples
Scene Navigation
Master Server
Netcoding Design Patterns
Troubleshooting
Miscellaneous
-
Connection Cycle Events
-
Rewinding
-
Network Logging
-
Working with Multiple Sockets
-
Modify Master and Standalone servers
-
NAT Hole Punching
-
UDP LAN Discovery
-
Offline Mode
-
Ping Pong
-
Lobby System
-
Upgrading Forge Remastered to Develop branch or different version
-
Forge Networking Classic to Remastered Migration Guide
-
Script to easily use Forge Networking from sources
-
Run Two Unity Instances with Shared Assets for Easiest Dedicated Client Workflow