In springboot, I'm trying to put the current date in my log filename lke this : 2020-01-31-log.log
I tried this :
logging:
level:
root: info
com.inyt.inytcirculationportal: debug
file:
name: "logs/%d-log.log"
but nothing seems to work.
Putting the date in the log file like this does not seem like a good idea to me, even if you were able to inject it somehow in your properties.
What if your application runs several days or months? You would only get a file per day if you restart the application at midnight. If you haven't done so, I'd recommend looking at the Logback RollingFileAppender, which will automatically archive your current log file and start a new one at the interval you configured.
With the date pattern you mentioned, your log folder could look like this: