In my vaadin application, I'd like to create one log file per user session. I started to create a customer file appender but then decided to investigate on ThreadContexts a bit more. I now store the user's uid inside the ThreadContext, which works fine within my PatternLayout (%X{uid}
), but unfortunately not inside the FileAppender (maybe I was a bit naive).
Which way would you go for something like this? Simply put, I'd like to get this result for the time being:
- User not logged in -> filename=debug.log
- User logged in -> filename=[username]_debug.log
Any ideas or pointers highly appreciated!