You can use the strftime
format in the file name of the appender path, which will generate a file name with the current date and time. Here's an example YAML configuration file:
appenders:
file:
kind: file
path: "logs/app_%Y-%m-%d.log"
encoder:
pattern: "{d} [{t}] {l} - {m}{n}"
root:
level: debug
appenders:
- file
In this example, the %Y-%m-%d
format in the file name will be replaced with the current date in the format YYYY-MM-DD.
So, when you run the application on October 31, 2021, the log file generated will be app_2021-10-31.log
.
You can also include the current time in the file name by adding the %H-%M-%S
format to the file name.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-07-31 11:00:00 +0000
Seen: 12 times
Last updated: Oct 07 '21
How can I transform a standard date to a Jalali date in ClickHouse?
What is the process for transforming a date into the desired format using the dayjs module?
Can you assist me with creating a calendar table in POWER BI?
How can I use the If function to exclude non-workdays?
Can the Excel cell entries be transformed into a uniform date and time format?