Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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.
java -Dserver.port=5743 -jar somejar.jar
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
Add a comment
I'd suggest to use Log4j with multiple appenders in your application.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.