标题翻译
Spring Boot - Shell commands interrupted by logging
问题
问题相当明了,但我会在这里进行详细说明。
TL;DR - 是否有办法防止系统打印和日志中断编写 Spring Boot 中的 shell 命令
我正在开发一个小型的 Spring Boot 应用程序,并添加了一些 shell 命令以提高用户体验。然而,每当用户连接到其中一个 API 端点时,我希能记录他们的活动。问题是这会中断编写 shell 命令,只有最后一行上的内容会被视为命令的一部分。我可以理解其中的逻辑,但是否有方法可以规避这个问题?根据我所发现的,使用简单的系统输入不会被日志中断。
英文翻译
The question is quite self explanatory, but I will elaborate here.
TL;DR - Is there a way to prevent system prints and logging from interrupting the writing of shell commands in Spring boot
I am developing a small Spring boot application and am adding some shell commands to make the user experience a bit better. However whenever a user connects to one of the API end points I want to log their activity. The issue is that this interrupts the writing of shell commands and only what remains on the last line is taken as part of the command. I can understand the logic behind this, but is there a way to circumvent that? From what I have found out using a simple system in doesn't get interrupted by the logging
专注分享java语言的经验与见解,让所有开发者获益!
评论