Let's say am running a Spring Boot app via CLI using java command java -Dserver.port=5743 -jar somejar.jar
and I want the logs to be printed within the cli and also copy into files.
So far I could do only one at a time either on CLI or file
Let's say am running a Spring Boot app via CLI using java command java -Dserver.port=5743 -jar somejar.jar
and I want the logs to be printed within the cli and also copy into files.
So far I could do only one at a time either on CLI or file
You can use the tee utility, it copies standard input to standard output, making a copy in zero or more files.
java -Dserver.port=5742 -jar somejar.jar | tee output.file