Logging outgoing traffic at server side

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

aseem.mittal
Posts: 1
Joined: 22 Jan 2019, 10:36

Logging outgoing traffic at server side

Postby aseem.mittal » 22 Jan 2019, 10:44

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?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Logging outgoing traffic at server side

Postby Lapo » 22 Jan 2019, 14:43

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
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Alexwek and 59 guests