@@ -34,68 +34,91 @@ public static function connection(ConnectionInterface $connection)
34
34
$ request = $ connection ->httpRequest ;
35
35
36
36
static ::log ($ connection ->app ->id , static ::TYPE_CONNECTION , [
37
- 'details ' => "Origin: {$ request ->getUri ()->getScheme ()}:// {$ request ->getUri ()->getHost ()}" ,
38
- 'socketId ' => $ connection ->socketId ,
37
+ 'details ' => [
38
+ 'origin ' => "{$ request ->getUri ()->getScheme ()}:// {$ request ->getUri ()->getHost ()}" ,
39
+ 'socketId ' => $ connection ->socketId ,
40
+ ],
39
41
]);
40
42
}
41
43
42
44
public static function occupied (ConnectionInterface $ connection , string $ channelName )
43
45
{
44
46
static ::log ($ connection ->app ->id , static ::TYPE_OCCUPIED , [
45
- 'details ' => "Channel: {$ channelName }" ,
47
+ 'details ' => [
48
+ 'channel ' => $ channelName ,
49
+ ],
46
50
]);
47
51
}
48
52
49
53
public static function subscribed (ConnectionInterface $ connection , string $ channelName )
50
54
{
51
55
static ::log ($ connection ->app ->id , static ::TYPE_SUBSCRIBED , [
52
- 'socketId ' => $ connection ->socketId ,
53
- 'details ' => "Channel: {$ channelName }" ,
56
+ 'details ' => [
57
+ 'socketId ' => $ connection ->socketId ,
58
+ 'channel ' => $ channelName ,
59
+ ],
54
60
]);
55
61
}
56
62
57
63
public static function clientMessage (ConnectionInterface $ connection , stdClass $ payload )
58
64
{
59
65
static ::log ($ connection ->app ->id , static ::TYPE_CLIENT_MESSAGE , [
60
- 'details ' => "Channel: {$ payload ->channel }, Event: {$ payload ->event }" ,
61
- 'socketId ' => $ connection ->socketId ,
62
- 'data ' => json_encode ($ payload ),
66
+ 'details ' => [
67
+ 'socketId ' => $ connection ->socketId ,
68
+ 'channel ' => $ payload ->channel ,
69
+ 'event ' => $ payload ->event ,
70
+ 'data ' => $ payload ,
71
+ ],
63
72
]);
64
73
}
65
74
66
75
public static function disconnection (ConnectionInterface $ connection )
67
76
{
68
77
static ::log ($ connection ->app ->id , static ::TYPE_DISCONNECTION , [
69
- 'socketId ' => $ connection ->socketId ,
78
+ 'details ' => [
79
+ 'socketId ' => $ connection ->socketId ,
80
+ ],
70
81
]);
71
82
}
72
83
73
84
public static function vacated (ConnectionInterface $ connection , string $ channelName )
74
85
{
75
86
static ::log ($ connection ->app ->id , static ::TYPE_VACATED , [
76
- 'details ' => "Channel: {$ channelName }" ,
87
+ 'details ' => [
88
+ 'socketId ' => $ connection ->socketId ,
89
+ 'channel ' => $ channelName ,
90
+ ],
77
91
]);
78
92
}
79
93
80
94
public static function apiMessage ($ appId , string $ channel , string $ event , string $ payload )
81
95
{
82
96
static ::log ($ appId , static ::TYPE_API_MESSAGE , [
83
- 'details ' => "Channel: {$ channel }, Event: {$ event }" ,
84
- 'data ' => $ payload ,
97
+ 'details ' => [
98
+ 'channel ' => $ connection ,
99
+ 'event ' => $ event ,
100
+ 'payload ' => $ payload ,
101
+ ],
85
102
]);
86
103
}
87
104
88
105
public static function replicatorSubscribed (string $ appId , string $ channel , string $ serverId )
89
106
{
90
107
static ::log ($ appId , static ::TYPE_REPLICATOR_SUBSCRIBED , [
91
- 'details ' => "Server ID: {$ serverId } on Channel: {$ channel }" ,
108
+ 'details ' => [
109
+ 'serverId ' => $ serverId ,
110
+ 'channel ' => $ channel ,
111
+ ],
92
112
]);
93
113
}
94
114
95
115
public static function replicatorUnsubscribed (string $ appId , string $ channel , string $ serverId )
96
116
{
97
117
static ::log ($ appId , static ::TYPE_REPLICATOR_UNSUBSCRIBED , [
98
- 'details ' => "Server ID: {$ serverId } on Channel: {$ channel }" ,
118
+ 'details ' => [
119
+ 'serverId ' => $ serverId ,
120
+ 'channel ' => $ channel ,
121
+ ],
99
122
]);
100
123
}
101
124
0 commit comments