I want to deal with log output with scala script. Like this:
java -jar app.jar | log.sc
or java -jar app.jar | amm log.sc
How to write a log.sc
deal with app.jar
print logs?
motivation
Replace java -jar app.jar > app.log
with some smarter way to handle the output stream.
From now on, I want save the output stream to different file by days.
Thanks.
UPDATE
think of this example:
object Main extends App {
var i = 0L
while(true) {
println("hello " + i)
i += 1
}
}
it assembly to a Loop.jar
, how can I deal with printing log to file by date?