Answer the question
In order to leave comments, you need to log in
How to correctly compose the path to the file?
There is such a project structure:
Task:
- in FileAppender you need to specify the path to the file to which the logs will be written.
What I did:
Registered a path like this:
log/$${date:dd:MM:yyyy}/log-$${date:dd:MM:yyyy-HH:mm}.txt
ERROR FileManager (log/21:04:2021/log-21:04:2021_15:58.txt) java.io.IOException: The filename, directory name, or volume label syntax is incorrect
fileName String The name of the file to write to. If the file, or any of its parent directories, do not exist, they will be created.which means if the file does not exist in the given path, it will be created. By what rules then the way is set?
Answer the question
In order to leave comments, you need to log in
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
The official Log4J 2 documentation says that
fileName String The name of the file to write to. If the file, or any of its parent directories, do not exist, they will be created.
which means if the file does not exist in the given path, it will be created. By what rules then the way is set?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question