add agent log
This commit is contained in:
parent
ebb95a8292
commit
c6442ed68a
|
@ -1,6 +1,7 @@
|
|||
package report
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
|
@ -127,6 +128,8 @@ func report() error {
|
|||
var body errRes
|
||||
err := httplib.Post(url).JSONBodyQuiet(form).Header("X-Srv-Token", config.Config.Report.Token).SetTimeout(time.Second * 5).ToJSON(&body)
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue