Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to append timestamp to file name for java.util.logging.FileHandler.pattern

Hi I was wondering if anyone knows a way to append a timestamp to the log file name specified through logging.properties java.util.logging.FileHandler.pattern

seems like something pretty straight forward but I cant seem to find a solution to this anywhere.

Thanks

like image 458
Alex Le Avatar asked Mar 24 '10 06:03

Alex Le


1 Answers

I am afraid that just by configuration you can't set the file name in teh way you want.

Have a look at the code in FileHandler.generate() to convince you.

What you can do is write your own FileHandler that will handle this naming or switch to another log framework.

If you use java.util.logging, I wrote some years ago a Formatter & a Handler that can still be usefull, feel free to use.

like image 115
Matthieu BROUILLARD Avatar answered Sep 23 '22 02:09

Matthieu BROUILLARD