查看/配置KeyCloak http服务器的访问日志

时间:2018-08-07 13:59:20

标签: keycloak

如何查看/配置KeyCloak使用的http服务器的访问日志?

我正在尝试调查与KeyCloak管理员ui的 connection_refused_error

3 个答案:

答案 0 :(得分:3)

尝试将以下<access-log>标记添加到WildFly服务器配置文件中,例如:standalone/configuration/standalone.xml

        <subsystem xmlns="urn:jboss:domain:undertow:4.0">
            <buffer-cache name="default"/>
            <server name="default-server">
                ...
                <host name="default-host" alias="localhost">
                    <location name="/" handler="welcome-content"/>
                    <!-- Add the following line -->
                    <access-log worker="default" directory="${jboss.server.log.dir}" prefix="access" suffix=".log"/>
                    <http-invoker security-realm="ApplicationRealm"/>
                    <filter-ref name="proxy-peer"/>
                </host>
            </server>

您可以在access.log目录中看到standalone/log/

答案 1 :(得分:0)

要扩展Kohei TAMURA答案:

为了在不重新加载Keycloak的情况下配置访问日志:

  1. 添加第<access-log worker="default" directory="${jboss.server.log.dir}" prefix="access." suffix="log"/>行 到 standalone / configuration / standalone.xml standalone / configuration / standalone-ha.xml (如果使用群集配置)。

  2. 重新加载Wildfly服务器配置,而无需重新启动它:

    jboss/keycloak/bin/jboss-cli.sh --connect
    [standalone@localhost:9990 /] reload
    

答案 2 :(得分:-1)

相关的一个:

如果您在docker中运行keycloak:

从“名称”列中获取正在运行的docker的名称:

docker ps -a

显示该容器的日志:

docker logs  <your-container-name-here>

尾部/跟踪该容器的日志:

 docker logs --follow   <your-container-name-here>

希望有帮助

相关问题