gpt4 book ai didi

keycloak - 查看/配置Keycloak HTTP服务器的访问日志

转载 作者:行者123 更新时间:2023-12-02 21:34:25 24 4
gpt4 key购买 nike

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

我正在尝试调查 Keycloak 管理 UI 的connection_refused_error

最佳答案

尝试添加以下内容 <access-log/>标记到您的服务器配置文件,例如: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 one line -->
<access-log prefix="access." />
<http-invoker security-realm="ApplicationRealm"/>
<filter-ref name="proxy-peer"/>
</host>
</server>

您可以看到access.log在你的standalone/log/重新启动 Keycloak 服务器后的目录,日志文件每天都会轮换,名称如 access.2019-07-26.log .

编辑:

您还可以按如下方式使用 JBoss CLI:

$ ./jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
[standalone@localhost:9990 /] /subsystem=undertow/server=default-server/host=default-host/setting=access-log:add
{"outcome" => "success"}

这些命令将一行添加到 standalone.xml :

<access-log/>

下一个命令显示访问日志设置(默认值):

[standalone@localhost:9990 /] /subsystem=undertow/server=default-server/host=default-host/setting=access-log:read-resource
{
"outcome" => "success",
"result" => {
"directory" => expression "${jboss.server.log.dir}",
"extended" => false,
"pattern" => "common",
"predicate" => undefined,
"prefix" => "access_log.",
"relative-to" => undefined,
"rotate" => true,
"suffix" => "log",
"use-server-log" => false,
"worker" => "default"
},
"response-headers" => {"process-state" => "reload-required"}
}

您可以通过以下命令更改属性(例如 prefix ):

[standalone@localhost:9990 /] /subsystem=undertow/server=default-server/host=default-host/setting=access-log:write-attribute(name=prefix,value=access.)

关于keycloak - 查看/配置Keycloak HTTP服务器的访问日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51728612/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com