@@ -40,7 +40,7 @@ public static function __callStatic($name, $arguments)
40
40
}
41
41
42
42
if (!is_array ($ arguments )) {
43
- $ arguments = [$ arguments ];
43
+ $ arguments = [$ arguments ];
44
44
}
45
45
46
46
if (isset ($ arguments [1 ])) {
@@ -80,27 +80,35 @@ public static function __callStatic($name, $arguments)
80
80
*/
81
81
public static function exception (Exception $ e , $ name = 'error ' )
82
82
{
83
- $ trackIdKey = env ('XLOG_TRACK_ID_KEY ' , 'xTrackId ' );
84
-
85
83
$ arguments = [];
86
84
$ arguments [0 ] = 'exception-> ' . $ e ->getMessage ();
87
85
$ arguments [1 ] = [
88
- 'code ' => $ e ->getCode (),
89
- 'file ' => basename ($ e ->getFile ()),
90
- 'line ' => $ e ->getLine (),
91
- $ trackIdKey => self ::getTrackId ($ trackIdKey ),
86
+ 'code ' => $ e ->getCode (),
87
+ 'file ' => basename ($ e ->getFile ()),
88
+ 'line ' => $ e ->getLine (),
89
+ self :: getTrackIdKey () => self ::getTrackId (),
92
90
];
93
91
94
92
return self ::__callStatic ($ name , $ arguments );
95
93
}
96
94
95
+ /**
96
+ * @return string
97
+ */
98
+ public static function getTrackIdKey ()
99
+ {
100
+ return env ('XLOG_TRACK_ID_KEY ' , 'xTrackId ' );
101
+ }
102
+
97
103
/**
98
104
* @param $trackIdKey
99
105
*
100
106
* @return string
101
107
*/
102
- protected static function getTrackId ($ trackIdKey )
108
+ protected static function getTrackId ()
103
109
{
110
+ $ trackIdKey = self ::getTrackIdKey ();
111
+
104
112
try {
105
113
$ trackId = resolve ($ trackIdKey );
106
114
} catch (Exception $ e ) {
0 commit comments