mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-22 14:26:31 +00:00
fix: get ctx logger on new request (#198)
* fix: get ctx logger on new request * chore: change log format * fix: get ctx logger on new request
This commit is contained in:
parent
cc97550f80
commit
2aea4a7a51
@ -65,6 +65,7 @@ func (pxy *Proxy) Start(ctx context.Context) {
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
ctx := util.GetCtxWithTraceId(ctx)
|
ctx := util.GetCtxWithTraceId(ctx)
|
||||||
|
logger := log.GetCtxLogger(ctx)
|
||||||
|
|
||||||
pkt, err := packet.ReadHttpRequest(conn)
|
pkt, err := packet.ReadHttpRequest(conn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -23,8 +23,8 @@ func GetCtxLogger(ctx context.Context) zerolog.Logger {
|
|||||||
|
|
||||||
func InitLogger(cfg *util.Config) {
|
func InitLogger(cfg *util.Config) {
|
||||||
partsOrder := []string{
|
partsOrder := []string{
|
||||||
zerolog.TimestampFieldName,
|
|
||||||
zerolog.LevelFieldName,
|
zerolog.LevelFieldName,
|
||||||
|
zerolog.TimestampFieldName,
|
||||||
traceIdFieldName,
|
traceIdFieldName,
|
||||||
scopeFieldName,
|
scopeFieldName,
|
||||||
zerolog.MessageFieldName,
|
zerolog.MessageFieldName,
|
||||||
|
Loading…
Reference in New Issue
Block a user