want to log the outgoing traffic from my SFS Server categorized with Extensions like Game and Zone.
SFSObject is getting used for sending commands.
Is there any readymade api in SFS which can do this?
Logging outgoing traffic at server side
-
- Posts: 1
- Joined: 22 Jan 2019, 10:36
Re: Logging outgoing traffic at server side
Hi,
if you turn on the DEBUG level of the Server's logging, you can see the outgoing packets in the logs, however there isn't a selective system to log only certain parts of the traffic.
http://docs2x.smartfoxserver.com/Gettin ... figuration
An alternative would be to manually log the SFSObjects you're sending before calling the SFSExtension's send() method.
SFSObject has two methods that can be used to dump its data: getDump() and getHexDump().
The former dumps the structure of the object while the latter creates an hex dump of its binary representation.
Keep in mind that doing this is recommended only during testing and not in production, where the logging and object dumping would affect the overall performance and generate very large log files.
Hope it helps
if you turn on the DEBUG level of the Server's logging, you can see the outgoing packets in the logs, however there isn't a selective system to log only certain parts of the traffic.
http://docs2x.smartfoxserver.com/Gettin ... figuration
An alternative would be to manually log the SFSObjects you're sending before calling the SFSExtension's send() method.
SFSObject has two methods that can be used to dump its data: getDump() and getHexDump().
The former dumps the structure of the object while the latter creates an hex dump of its binary representation.
Keep in mind that doing this is recommended only during testing and not in production, where the logging and object dumping would affect the overall performance and generate very large log files.
Hope it helps
Who is online
Users browsing this forum: Alexwek and 59 guests