Starting keycloak 18 in debug mode

64 views
Skip to first unread message

zakariae Lebriq

unread,
May 11, 2022, 5:04:18 AM5/11/22
to Keycloak User
Hello guys, 

My need is to debug my own SPI from my local intellij, 

Does any one have any idea about how to enable debug mode in keycloak 18 ?

I've checked the --help of start & start-dev commands, but nothing useful :( 

Regards

Garth

unread,
May 11, 2022, 5:26:16 AM5/11/22
to 'Thomas Darimont' via Keycloak User
+1 for this. I haven’t been able to set this up since the switch to Quarkus. Any pointers or documentation would be greatly appreciated.
> --
> You received this message because you are subscribed to the Google
> Groups "Keycloak User" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to keycloak-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/keycloak-user/4af7f023-2ba7-43a7-85dd-4f840fafdc17n%40googlegroups.com
> <https://groups.google.com/d/msgid/keycloak-user/4af7f023-2ba7-43a7-85dd-4f840fafdc17n%40googlegroups.com?utm_medium=email&utm_source=footer>.

zakariae Lebriq

unread,
May 11, 2022, 10:08:53 AM5/11/22
to Keycloak User
Hello, 

ouuuf finally  after working for few hours on this topic, looking at all the  blogs, I found out the solution in keycloak itself 

*** First step : 
Add this env vars : 

export DEBUG=true
export DEBUG_PORT=1111
export JAVA_OPTS="agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:1111"

*** Second step : 

Enable your port binding in your docker : 

docker-compose in my case : 
ports:
- 1111:1111

*** Third and last step: 

Start your docker after build and start debug from your intellij.  

Coffee time for me :) 
Regards 

Thomas Darimont

unread,
May 11, 2022, 10:25:57 AM5/11/22
to Keycloak User
Hello,

I usually set the following variables to enable remote debugging in Keycloak (Quarkus)

# Enable remote debugging
DEBUG: "true"
DEBUG_PORT: "*:8787"

Cheers,
Thomas

Reply all
Reply to author
Forward
0 new messages