I’m using the Tinylog library with the “rolling file” function to write logs to a file. Sometimes I need to clear a file. Tried to do it with normal Java methods but it breaks the file and makes it hard to read. Is there a way to clear the log file at any point so it doesn’t break? Answer You
Tag: tinylog
Using tinylog with two console writers in parallel
I am using https://mvnrepository.com/artifact/org.tinylog/tinylog-api/2.2.0 in our project. I can configure my writer format the following way: But now I need a different output format for some loggers. Is this possible with tinylog? If yes, can someone provide a short example how to do this? Thanks … Answer You can use tags (https://tinylog.org/v2/configuration/#tags): Tagged loggers can be created via TaggedLogger logger
How to create config properties for tinylog at runtime with User preferences
I would like the user to be able to choose where the error logs in my application are sent to. I am using tinylog at the moment. I have used their example code to configure where errors are written to (the user preference is chosen via a Swing fileChooser). Their example is: which I have changed to: However I get