Keycloak SPI logging

I’m developing a keycloak event listener and I managed to do that, but I’m having an issue with writing to $KEYCLOAK_DIR/standalone/log/server.log

I assumed that this is where jboss writes out all logs, and that any logging done in a custom SPI would also be written into this file, but this doesnt seem like the case.

Could someone check this out please?

Is your code available somewhere? Without knowing what you do (or did), it‘s hard to guess.

Actually, I just noticed that when I download the tar.gz and run keycloak as standalone, everything works fine. Keycloak as is logs to server.log as well as my event listener.

However previously, I was working with a docker container, and now I see - once I run the container, initially jboss and keycloak log into server.log, but then no more logs appear (from SPI event listener or jboss e.g. login error)

Here’s the code (it should be reproducable by running or following the install.sh)

In the Docker image, Keycloak is configured to log only to STDOUT, not to a logfile. This is best practice for containers, as logging to files would increase the containersize at some point and this might lead into other issues…

You should be able to gather the logs from your container with the docker logs ... command.

awesome - makes sense indeed

thanks a lot @dasniko