Cant set variable by logger.With #1407
Unanswered
xiaoke4869
asked this question in
Q&A
Replies: 1 comment
-
log file always output "init"
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is my code,and I want to set trace_id into log file. The trace_id is generate on middleware
The result is:
console output:
BUT, zap.log didn't write traceId:
log file:
Strangely enough
log file:
code:
![image](https://private-user-images.githubusercontent.com/27657982/301442755-1c15c03d-68c5-4521-8437-539af0c0df0a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3ODE3MzEsIm5iZiI6MTcxOTc4MTQzMSwicGF0aCI6Ii8yNzY1Nzk4Mi8zMDE0NDI3NTUtMWMxNWMwM2QtNjhjNS00NTIxLTg0MzctNTM5YWYwYzBkZjBhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjMwVDIxMDM1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlmNGM0MmVhNzBmN2IwYmYxMDNjYzA0YjdjMmVkMzc3Y2IyOTQ3MTEzNzhmZDMxY2M1Yzc1MzhhMzg4ZTczMGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.FDYHVSpG5c4tIgbu7C7N9UhinpmyI_yLOiQvCj9aPXk)
It works... What should I do? Thx.
Beta Was this translation helpful? Give feedback.
All reactions