is OpenEMS actually permanently writing data in a database (log4j)? If so, how can I read it out? If not, how can I create a copy of the logged datastream on my computer?
log4j itself is only a logging processor. If you would want to write all log outputs to a file you would have to configure a service that does that - e.g. using some existing service or similar to how the Websocket-Api-Controller forwards all logs to the UI if you open that view in the UI. See here
I suspect you are mainly interested in what the DebugLogController by default logs to the console. In that case you could just adapt the run()-method accordingly.