How can i get the current log file name on runtime from tinylog

134 views Asked by At

i am using tinylog 2 and i want to load the current log file content to show it in my gui. My tinylog.properties looks something like this:

writer=rolling file
writer.file=project_{date: yyyy-MM-dd}.log

So my problem is: How can i get the current filename of the logger file ? i can resolve it with hard coded java String formatter, but when someone change the properties file it doesn't fit. Is there a way to get the current resolved logfile name from Tinylog? Thanks

1

There are 1 answers

1
Martin On

tinylog 2 does not provide any specific API for receiving the file name. However, feel free to file a feature request on GitHub. As the main contributor of tinylog, I could imagine to implement such feature for tinylog 2 or 3. Especially, I'm thinking about a listener that could automatically inform you about a rollover event and provide the new file name.