add agent log
This commit is contained in:
parent
ebb95a8292
commit
c6442ed68a
|
@ -1,6 +1,7 @@
|
||||||
package report
|
package report
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
|
@ -127,6 +128,8 @@ func report() error {
|
||||||
var body errRes
|
var body errRes
|
||||||
err := httplib.Post(url).JSONBodyQuiet(form).Header("X-Srv-Token", config.Config.Report.Token).SetTimeout(time.Second * 5).ToJSON(&body)
|
err := httplib.Post(url).JSONBodyQuiet(form).Header("X-Srv-Token", config.Config.Report.Token).SetTimeout(time.Second * 5).ToJSON(&body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
js, _ := json.Marshal(form)
|
||||||
|
logger.Errorf("report payload: %s, token: %s", string(js), config.Config.Report.Token)
|
||||||
return fmt.Errorf("curl %s fail: %v", url, err)
|
return fmt.Errorf("curl %s fail: %v", url, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue