First: Yes, it's kinda strange to pass the factory class along with its initialization parameters. But for me we don't have to build like that.

Second: I really like this idea. I already thought about it to change the logging from Guacamole or somewhere else. But for we don't need a (public) factory if we make each middleware configurable. Additionally I don't think we can create a nice looking interface to support this. We eventually will if we spend a lot of time, but I'm not sure if this is feasible.