I want to create the log file per request in the format below, using java util logging.
YYYYMMDD_HHMMSS.log
Anybody please let me know how can I achieve this using java util logging?
I want to create the log file per request in the format below, using java util logging.
YYYYMMDD_HHMMSS.log
Anybody please let me know how can I achieve this using java util logging?
Copyright © 2021 Jogjafile Inc.
The FileHandler doesn't support generating file names by date and time from the LogManager.
If you want to generate a file name on startup you can subclass the FileHandler and create a static method to generate your file name using a SimpleDateFormat. The LogManager supports a 'config' option that will also allow you to install custom code to setup and install a FileHandler.
If you want to generate a file name per each LogRecord you have to create a custom Handler that will create and close a FileHandler on each publish.