New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to write request log and error log in a separate manner. #1376
Comments
|
En. Maybe You have a misconception about issues 805 1. The request log will be fomartted and logged by 2. If just want Based on the above two points
is enough |
Hi, Thanks for your reply! Just log.Println(err) doesn't make records in the error log. --
|
Because -- Actually, you can use
But it depend on you(developer). |
Thanks. (B) I suppose another approach could be to use fmt.Fprinln(gin.DefaultErrorWriter, "some error message") directly, and confirmed this would write error to error log. -- In summary (A), (B), or (C) could be solution. @chainhelen thanks again!! --
|
@chainhelen All Right |
@nowissan |
@syssam |
replace gin log, reference |
I could write everything into a file with #805 post.
Related to this, how could it be possible to write error into a separate log?
--
I assume to use gin.DefaultErrorWriter, but it seems that log.SetOuput is only possible with a single file.
Current output (everything into a single file)
Current code
The text was updated successfully, but these errors were encountered: