wildfly-logstash 不将日志发送到logstash

2024-05-17

我正在使用 jboss/keycloak:11.0.2 和 wildfly-logstash (https://github.com/kifj/wildfly-logstash https://github.com/kifj/wildfly-logstash)用于将日志从 Wildfly 传输到 Logstash。当logstash早于wildfly启动时,我遇到了一个问题,在这种情况下,日志不会发送到logstash。有时我会看到这样的日志myHost:名称或服务未知。 Logger 不会尝试重新连接到 myHost。只需重新启动即可。 Wildfly启动脚本示例:

embed-server --server-config=standalone-ha.xml --std-out=echo
module add --name=x1.wildfly-logstash --dependencies=org.jboss.logmanager,org.jboss.logging,javax.json.api --resources=/tmp/wildfly-logstash.jar

/subsystem=logging/custom-formatter=LOGSTASH-PATTERN:add(\
  class=net.logstash.logging.formatter.LogstashUtilFormatter,\
  module=x1.wildfly-logstash)

/subsystem=logging/custom-handler=LOGSTASH-SOCKET:add(level=DEBUG, class=net.logstash.logging.handler.SocketHandler,module=x1.wildfly-logstash,named-formatter=LOGSTASH-PATTERN,properties={hostname=myHost, port=${env.port}})

/subsystem=logging/async-handler=LOGSTASH-ASYNC:add(queue-length=512, subhandlers=[LOGSTASH-SOCKET])

/subsystem=logging/root-logger=ROOT:add-handler(name=LOGSTASH-ASYNC)

stop-embedded-server

有人知道如何解决它吗?

Updated

08:42:15,759 INFO  [org.jboss.msc] (CLI command executor) JBoss MSC version 1.4.11.Final
08:42:15,770 INFO  [org.jboss.threads] (CLI command executor) JBoss Threads version 2.3.3.Final
08:42:15,913 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: Keycloak 11.0.2 (WildFly Core 12.0.3.Final) starting
08:42:16,080 INFO  [org.jboss.vfs] (MSC service thread 1-2) VFS000002: Failed to clean existing content for temp file provider of type temp. Enable DEBUG level log to find what caused this
08:42:17,124 INFO  [org.wildfly.security] (ServerService Thread Pool -- 19) ELY00001: WildFly Elytron version 1.12.1.Final
08:42:17,948 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
08:42:18,055 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
08:42:18,205 INFO  [org.jboss.as.patching] (MSC service thread 1-7) WFLYPAT0050: Keycloak cumulative patch ID is: base, one-off patches include: none
08:42:18,219 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-2) WFLYDM0111: Keystore /opt/jboss/keycloak/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
08:42:18,330 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
08:42:18,335 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: Keycloak 11.0.2 (WildFly Core 12.0.3.Final) started in 2661ms - Started 56 of 79 services (32 services are lazy, passive or on-demand)
The batch executed successfully
08:42:18,661 INFO  [org.jboss.as] (MSC service thread 1-7) WFLYSRV0050: Keycloak 11.0.2 (WildFly Core 12.0.3.Final) stopped in 15ms
08:42:20,127 INFO  [org.jboss.modules] (CLI command executor) JBoss Modules version 1.10.1.Final
08:42:20,197 INFO  [org.jboss.msc] (CLI command executor) JBoss MSC version 1.4.11.Final
08:42:20,206 INFO  [org.jboss.threads] (CLI command executor) JBoss Threads version 2.3.3.Final
08:42:20,337 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: Keycloak 11.0.2 (WildFly Core 12.0.3.Final) starting
08:42:20,428 INFO  [org.jboss.vfs] (MSC service thread 1-2) VFS000002: Failed to clean existing content for temp file provider of type temp. Enable DEBUG level log to find what caused this
08:42:21,238 INFO  [org.wildfly.security] (ServerService Thread Pool -- 21) ELY00001: WildFly Elytron version 1.12.1.Final
08:42:22,373 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
08:42:22,526 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
08:42:22,671 INFO  [org.jboss.as.patching] (MSC service thread 1-2) WFLYPAT0050: Keycloak cumulative patch ID is: base, one-off patches include: none
08:42:22,685 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-8) WFLYDM0111: Keystore /opt/jboss/keycloak/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
08:42:22,772 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
08:42:22,773 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: Keycloak 11.0.2 (WildFly Core 12.0.3.Final) started in 2640ms - Started 56 of 86 services (39 services are lazy, passive or on-demand)
The batch executed successfully
08:42:22,943 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0050: Keycloak 11.0.2 (WildFly Core 12.0.3.Final) stopped in 18ms
Executing cli script: /opt/jboss/startup-scripts/logstash-logging.cli
08:42:24,182 INFO  [org.jboss.modules] (CLI command executor) JBoss Modules version 1.10.1.Final
08:42:24,233 INFO  [org.jboss.msc] (CLI command executor) JBoss MSC version 1.4.11.Final
08:42:24,243 INFO  [org.jboss.threads] (CLI command executor) JBoss Threads version 2.3.3.Final
08:42:24,360 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: Keycloak 11.0.2 (WildFly Core 12.0.3.Final) starting
08:42:24,449 INFO  [org.jboss.vfs] (MSC service thread 1-6) VFS000002: Failed to clean existing content for temp file provider of type temp. Enable DEBUG level log to find what caused this
08:42:25,020 INFO  [org.wildfly.security] (ServerService Thread Pool -- 20) ELY00001: WildFly Elytron version 1.12.1.Final
08:42:25,928 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
08:42:26,032 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
08:42:26,172 INFO  [org.jboss.as.patching] (MSC service thread 1-8) WFLYPAT0050: Keycloak cumulative patch ID is: base, one-off patches include: none
08:42:26,182 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-5) WFLYDM0111: Keystore /opt/jboss/keycloak/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
08:42:26,266 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
08:42:26,268 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: Keycloak 11.0.2 (WildFly Core 12.0.3.Final) started in 2081ms - Started 56 of 86 services (39 services are lazy, passive or on-demand)
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
JAVA_OPTS already set in environment; overriding default settings with values:  -Dkeycloak.profile.feature.authz_drools_policy=enabled -Dkeycloak.profile.feature.upload_scripts=enabled -Djava.net.preferIPv4Stack=true
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/jboss/keycloak

  JAVA: java

  JAVA_OPTS:  -server  -Dkeycloak.profile.feature.authz_drools_policy=enabled -Dkeycloak.profile.feature.upload_scripts=enabled -Djava.net.preferIPv4Stack=true  --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED

=========================================================================

08:42:27,098 INFO  [org.jboss.modules] (main) JBoss Modules version 1.10.1.Final
08:42:27,570 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.11.Final
08:42:27,577 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
08:42:27,661 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: Keycloak 11.0.2 (WildFly Core 12.0.3.Final) starting
08:42:27,755 INFO  [org.jboss.vfs] (MSC service thread 1-8) VFS000002: Failed to clean existing content for temp file provider of type temp. Enable DEBUG level log to find what caused this
08:42:28,424 INFO  [org.wildfly.security] (ServerService Thread Pool -- 20) ELY00001: WildFly Elytron version 1.12.1.Final
08:42:29,278 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
08:42:29,367 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 28) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
08:42:29,403 INFO  [org.jboss.as.repository] (ServerService Thread Pool -- 23) WFLYDR0001: Content added at location /opt/jboss/keycloak/standalone/data/content/2f/209df99aaed727ee0550f516d84eeb80382895/content
08:42:29,646 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
08:42:29,667 INFO  [org.xnio] (MSC service thread 1-5) XNIO version 3.8.1.Final
08:42:29,677 INFO  [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.8.1.Final
08:42:29,739 INFO  [org.jboss.remoting] (MSC service thread 1-8) JBoss Remoting version 5.0.18.Final
08:42:29,772 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 40) WFLYIO001: Worker 'default' has auto-configured to 16 IO threads with 128 max task threads based on your 8 available processors
08:42:29,786 INFO  [org.jboss.as.clustering.jgroups] (ServerService Thread Pool -- 43) WFLYCLJG0001: Activating JGroups subsystem. JGroups version 4.2.4
08:42:29,794 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 34) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
08:42:29,832 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 34) WFLYJCA0005: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 42.2)
08:42:29,851 INFO  [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 48) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem
08:42:29,835 INFO  [org.jboss.as.connector] (MSC service thread 1-4) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.22.Final)
08:42:29,843 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0018: Started Driver service with driver-name = h2
08:42:29,881 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) WFLYJCA0018: Started Driver service with driver-name = postgresql
08:42:29,815 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 41) WFLYRS0016: RESTEasy version 3.12.1.Final
08:42:29,972 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 55) WFLYSEC0002: Activating Security Subsystem
08:42:29,974 INFO  [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 49) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
08:42:29,974 INFO  [org.wildfly.extension.microprofile.metrics.smallrye] (ServerService Thread Pool -- 50) WFLYMETRICS0001: Activating Eclipse MicroProfile Metrics Subsystem
08:42:29,978 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 39) WFLYCLINF0001: Activating Infinispan subsystem.
08:42:29,969 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 52) WFLYNAM0001: Activating Naming Subsystem
08:42:29,891 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 57) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
08:42:30,107 INFO  [org.jboss.as.security] (MSC service thread 1-5) WFLYSEC0001: Current PicketBox version=5.0.3.Final-redhat-00005
08:42:30,164 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0003: Undertow 2.1.3.Final starting
08:42:30,204 INFO  [org.jboss.as.naming] (MSC service thread 1-2) WFLYNAM0003: Starting Naming Service
08:42:30,244 WARN  [org.wildfly.clustering.web.undertow] (ServerService Thread Pool -- 58) WFLYCLWEBUT0007: No routing provider found for default-server; using legacy provider based on static configuration
08:42:30,251 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-3) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
08:42:30,397 INFO  [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host.
08:42:30,400 INFO  [org.jboss.as.ejb3] (MSC service thread 1-6) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
08:42:30,498 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 58) WFLYUT0014: Creating file handler for path '/opt/jboss/keycloak/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
08:42:30,509 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0012: Started server default-server.
08:42:30,512 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0018: Host default-host starting
08:42:30,661 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0006: Undertow AJP listener ajp listening on 0.0.0.0:8009
08:42:30,662 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0006: Undertow HTTP listener default listening on 0.0.0.0:8080
08:42:30,673 INFO  [org.jboss.modcluster] (ServerService Thread Pool -- 60) MODCLUSTER000001: Initializing mod_cluster version 1.4.1.Final
08:42:30,711 INFO  [org.jboss.modcluster] (ServerService Thread Pool -- 60) MODCLUSTER000032: Listening to proxy advertisements on /224.0.1.105:23364
08:42:30,883 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0493: EJB subsystem suspension complete
08:42:31,004 INFO  [org.jboss.as.patching] (MSC service thread 1-7) WFLYPAT0050: Keycloak cumulative patch ID is: base, one-off patches include: none
08:42:31,036 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) WFLYJCA0001: Bound data source [java:jboss/datasources/KeycloakDS]
08:42:31,036 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
08:42:31,060 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-8) WFLYDM0111: Keystore /opt/jboss/keycloak/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
08:42:31,100 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-7) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/jboss/keycloak/standalone/deployments
08:42:31,122 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "keycloak-server.war" (runtime-name: "keycloak-server.war")
08:42:31,268 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTPS listener https listening on 0.0.0.0:8443
08:42:32,118 WARN  [org.jgroups.protocols.UDP] (ServerService Thread Pool -- 60) JGRP000015: the send buffer of socket ManagedMulticastSocketBinding was set to 1.00MB, but the OS only allocated 212.99KB
08:42:32,118 WARN  [org.jgroups.protocols.UDP] (ServerService Thread Pool -- 60) JGRP000015: the receive buffer of socket ManagedMulticastSocketBinding was set to 20.00MB, but the OS only allocated 212.99KB
08:42:32,119 WARN  [org.jgroups.protocols.UDP] (ServerService Thread Pool -- 60) JGRP000015: the send buffer of socket ManagedMulticastSocketBinding was set to 1.00MB, but the OS only allocated 212.99KB
08:42:32,119 WARN  [org.jgroups.protocols.UDP] (ServerService Thread Pool -- 60) JGRP000015: the receive buffer of socket ManagedMulticastSocketBinding was set to 25.00MB, but the OS only allocated 212.99KB
08:42:32,587 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service org.wildfly.logging.handler."org.wildfly.logging.handler.LOGSTASH-SOCKET": org.jboss.msc.service.StartException in service org.wildfly.logging.handler."org.wildfly.logging.handler.LOGSTASH-SOCKET": Failed to start service
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.UncheckedIOException: java.net.UnknownHostException: myHost: Name or service not known
    at org.jbos[email protected] /cdn-cgi/l/email-protection//org.jboss.as.logging.handlers.SocketHandlerResourceDefinition$WildFlyClientSocketFactory.getAddress(SocketHandlerResourceDefinition.java:448)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.logmanager.handlers.SocketHandler.<init>(SocketHandler.java:185)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.as.logging.handlers.SocketHandlerResourceDefinition$1$2$1.start(SocketHandlerResourceDefinition.java:242)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
    ... 6 more
Caused by: java.net.UnknownHostException: myHost: Name or service not known
    at java.base/java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
    at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929)
    at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1515)
    at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848)
    at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1505)
    at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1364)
    at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1298)
    at java.base/java.net.InetAddress.getByName(InetAddress.java:1248)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.as.network.OutboundSocketBinding.getResolvedDestinationAddress(OutboundSocketBinding.java:159)
    at [email protected] /cdn-cgi/l/email-protection//org.jboss.as.logging.handlers.SocketHandlerResourceDefinition$WildFlyClientSocketFactory.getAddress(SocketHandlerResourceDefinition.java:446)
    ... 10 more

08:42:35,158 INFO  [org.jgroups.protocols.pbcast.GMS] (ServerService Thread Pool -- 60) 81aea0e8fa13: no members discovered after 3007 ms: creating cluster as coordinator
08:42:36,214 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0273: Excluded subsystem webservices via jboss-deployment-structure.xml does not exist.
08:42:36,687 INFO  [org.keycloak.services] (ServerService Thread Pool -- 62) KC-SERVICES0001: Loading config from standalone.xml or domain.xml
08:42:36,786 WARN  [org.keycloak.common.Profile] (ServerService Thread Pool -- 62) Deprecated feature enabled: upload_scripts
08:42:36,786 WARN  [org.keycloak.common.Profile] (ServerService Thread Pool -- 62) Preview feature enabled: scripts
08:42:36,972 INFO  [org.keycloak.url.DefaultHostnameProviderFactory] (ServerService Thread Pool -- 62) Frontend: http://localhost:8100/auth, Admin: <frontend>, Backend: <request>
08:42:37,203 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 62) WFLYCLINF0002: Started realmRevisions cache from keycloak container
08:42:37,206 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 62) WFLYCLINF0002: Started userRevisions cache from keycloak container
08:42:37,211 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 62) WFLYCLINF0002: Started authorizationRevisions cache from keycloak container
08:42:37,213 INFO  [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (ServerService Thread Pool -- 62) Node name: 81aea0e8fa13, Site name: null
08:42:40,226 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 62) HHH000204: Processing PersistenceUnitInfo [
    name: keycloak-default
    ...]
08:42:40,330 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 62) HHH000412: Hibernate Core {5.3.17.Final}
08:42:40,332 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 62) HHH000206: hibernate.properties not found
08:42:40,566 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 62) HCANN000001: Hibernate Commons Annotations {5.0.5.Final}
08:42:40,849 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 62) HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect
08:42:41,249 INFO  [org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl] (ServerService Thread Pool -- 62) HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
08:42:41,258 INFO  [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 62) HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@210c2412
08:42:41,267 INFO  [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool -- 62) Envers integration enabled? : true
08:42:42,324 INFO  [org.hibernate.orm.beans] (ServerService Thread Pool -- 62) HHH10005002: No explicit CDI BeanManager reference was passed to Hibernate, but CDI is available on the Hibernate ClassLoader.
08:42:42,426 INFO  [org.hibernate.validator.internal.util.Version] (ServerService Thread Pool -- 62) HV000001: Hibernate Validator 6.0.20.Final
08:42:44,259 INFO  [org.hibernate.hql.internal.QueryTranslatorFactoryInitiator] (ServerService Thread Pool -- 62) HHH000397: Using ASTQueryTranslatorFactory
08:42:45,309 INFO  [org.keycloak.services] (ServerService Thread Pool -- 62) KC-SERVICES0006: Importing users from '/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json'
08:42:45,517 WARN  [org.keycloak.services] (ServerService Thread Pool -- 62) KC-SERVICES0104: Not creating user admin. It already exists.
08:42:45,567 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 62) RESTEASY002225: Deploying javax.ws.rs.core.Application: class org.keycloak.services.resources.KeycloakApplication
08:42:45,569 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 62) RESTEASY002205: Adding provider class org.keycloak.services.filters.KeycloakSecurityHeadersFilter from Application class org.keycloak.services.resources.KeycloakApplication
08:42:45,570 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 62) RESTEASY002205: Adding provider class org.keycloak.services.error.KeycloakErrorHandler from Application class org.keycloak.services.resources.KeycloakApplication
08:42:45,571 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 62) RESTEASY002200: Adding class resource org.keycloak.services.resources.ThemeResource from Application class org.keycloak.services.resources.KeycloakApplication
08:42:45,571 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 62) RESTEASY002200: Adding class resource org.keycloak.services.resources.JsResource from Application class org.keycloak.services.resources.KeycloakApplication
08:42:45,571 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 62) RESTEASY002220: Adding singleton resource org.keycloak.services.resources.RobotsResource from Application class org.keycloak.services.resources.KeycloakApplication
08:42:45,571 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 62) RESTEASY002210: Adding provider singleton org.keycloak.services.util.ObjectMapperResolver from Application class org.keycloak.services.resources.KeycloakApplication
08:42:45,572 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 62) RESTEASY002220: Adding singleton resource org.keycloak.services.resources.WelcomeResource from Application class org.keycloak.services.resources.KeycloakApplication
08:42:45,572 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 62) RESTEASY002220: Adding singleton resource org.keycloak.services.resources.admin.AdminRoot from Application class org.keycloak.services.resources.KeycloakApplication
08:42:45,572 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 62) RESTEASY002220: Adding singleton resource org.keycloak.services.resources.RealmsResource from Application class org.keycloak.services.resources.KeycloakApplication
08:42:45,687 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 62) WFLYUT0021: Registered web context: '/auth' for server 'default-server'
08:42:45,816 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "logging"),
    ("socket-handler" => "LOGSTASH-SOCKET")
]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.logging.handler.\"org.wildfly.logging.handler.LOGSTASH-SOCKET\"" => "Failed to start service
    Caused by: java.io.UncheckedIOException: java.net.UnknownHostException: myHost: Name or service not known
    Caused by: java.net.UnknownHostException: myHost: Name or service not known"}}
08:42:45,831 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 46) WFLYSRV0010: Deployed "keycloak-server.war" (runtime-name : "keycloak-server.war")
08:42:45,832 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service org.wildfly.logging.handler."org.wildfly.logging.handler.LOGSTASH-SOCKET": Failed to start service

08:42:45,902 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
08:42:45,906 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: Keycloak 11.0.2 (WildFly Core 12.0.3.Final) started (with errors) in 19124ms - Started 732 of 1039 services (1 services failed or missing dependencies, 707 services are lazy, passive or on-demand)
08:42:45,908 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
08:42:45,908 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990

实际上您不需要安装该模块来实现此目的。 WildFly 有一个内置的json-formatter and socket-handler。事实上,很多代码看起来像是取自 JBoss 日志管理器:) 唯一的区别是字段。通过下面的示例,我将向您展示一个可以使用的选项。

embed-server --server-config=standalone-ha.xml --std-out=echo

/subsystem=logging/json-formatter=LOG-STASH:add(key-overrides={timestamp=@timestamp,message=@message,logger-name=@source,host-name=@source_host}, exception-output-type=formatted)

/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=log-stash:add(host=localhost, port=${env.port})
/subsystem=logging/socket-handler=LOGSTASH-SOCKET:add(named-formatter=LOG-STASH, outbound-socket-binding-ref=log-stash, level=DEBUG)

/subsystem=logging/async-handler=LOGSTASH-ASYNC:add(queue-length=512, subhandlers=[LOGSTASH-SOCKET])

/subsystem=logging/root-logger=ROOT:add-handler(name=LOGSTASH-ASYNC)

stop-embedded-server

The socket-handler如果连接失败,将尝试重新连接。您可以使用block-on-reconnect=true属性,如果您想阻止直到可以重置连接。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

wildfly-logstash 不将日志发送到logstash 的相关文章

  • 我的石墨中的 Logstash 指标在哪里?

    这可能是一个菜鸟问题 但我很难找到答案 所以我希望你们能在这里帮助我 我有一个running logstash实例将日志从一台服务器传送到另一台运行 Graphite 的服务器 这是我的输出配置 output stdout codec gt
  • 在 Docker 容器中以主机用户身份运行

    在我的团队中 我们在进行开发时使用 Docker 容器在本地运行我们的网站应用程序 假设我正在开发 Flask 应用程序app py具有依赖关系requirements txt 工作流程大致如下 I am robin and I am in
  • Docker nginx 代理到主机

    简短的介绍 Nginx 运行在 docker 上 如何配置 nginx 以便将调用转发到主机 详细描述 我们有一个 Web 应用程序与几个后端通信 假设为rest1 rest2 和rest3 我们负责rest1 让我们考虑一下我开始rest
  • Docker 主机上运行的容器是否有最大数量?

    基本上 标题说明了一切 在单个 Docker 主机上同时运行的容器数量是否有限制 您可能会遇到 并解决 许多系统限制 但存在大量灰色区域 具体取决于 您如何配置 Docker 容器 您在容器中运行的内容 您使用的内核 发行版和 docker
  • Logstash if 语句与正则表达式示例

    谁能告诉我什么是if带有正则表达式的语句看起来像在logstash中 我的尝试 if fieldname 0 9 if fieldname 0 9 两者都不起作用 我打算做的是检查 fieldname 是否包含整数 将其他答案合并成一个有凝
  • 如何在 Docker 多阶段构建层中缓存 Maven 依赖项和插件?

    我想将 Maven 依赖项缓存在我的构建阶段的一层中Docker 多阶段构建 https docs docker com engine userguide eng image multistage build 我的 Dockerfile 如
  • Docker exec linux 终端创建别名

    我有一个正在运行且独立的容器 我想在附加到该容器之前创建一个命令别名 当我连接到容器并输入 alias bar foo 创建别名 并可以通过以下方式检查 alias command 但如果我想做同样的事情码头执行者命令即这样 docker
  • Ctrl-p 和 Ctrl-n 在 Docker 下表现异常

    For the life of me I can t seem to figure out why ctrl p and ctrl n don t work like they re supposed to under the Docker
  • Docker CentOS systemctl 不允许

    我尝试使用 systemctl 命令构建 CentOS 映像 但每次当我建造它时 我收到此错误 Step 5 7 RUN systemctl enable syslog ng systemctl start syslog ng gt Run
  • 如何使用缓存快速重建dockerfile?

    我想优化我的 Dockerfile 我希望将缓存文件保留在磁盘中 但是 当我跑步的时候我发现docker build 它总是尝试从网络获取每个文件 我希望在构建期间共享我的缓存目录 例如 var cache yum x86 64 6 但是
  • 如何在没有 Visual Studio 和 docker compose 的情况下使用 docker 复制 csproj 文件?

    我刚刚使用 Visual Studio 15 8 8 启动了一个 NET Core 项目 2 1 的新解决方案 通过将docker compose文件设置为启动项目即可运行和调试 有用 从逻辑上讲 我应该能够使用简单的命令行语句构建 doc
  • 如何扁平化 Docker 镜像?

    我做了一个相当大的 Docker 容器 当我提交容器来创建映像时 映像大约有 7 8 GB 大 但当我export容器 不是save图像 到 tarball 并重新导入 图像只有 3 GB 大 当然 历史记录丢失了 但这对我来说没问题 因为
  • Keycloak - 代理后面的 URL 重置密码电子邮件

    我们正在使用钥匙斗篷 2 0 0 Final安装在后面Nginx 代理在 RedHat 环境上 我们目前面临的问题是重设密码使用内部服务器主机而不是操作 URL 中的外部服务器发送电子邮件的功能 因为我们位于代理后面 我通过电子邮件收到此信
  • 为 Ruby On Rails 环境创建 Docker 映像时出错(从 Dockerfile)

    估计是环境问题 当我手动执行此操作 没有 Dockerfile 时 它可以工作 这是我的 Dockerfile FROM ubuntu 14 04 RUN apt get update RUN apt get upgrade assume
  • kubectl:在 WSL 终端中找不到

    我按照以下说明在 Windows10 上安装了 WSL2 https learn microsoft com en us windows wsl install win10 https learn microsoft com en us w
  • Logstash 中的数学函数

    我期待对 Logstash 中收到的输入进行数学运算 但无法看到任何此类操作filter 输入如下 user id User123 date 2016 Jun 26 12 00 12 data doc name mydocs xls doc
  • JBoss AS 7 禁用热部署

    在以前的版本中 您只需禁用conf jboss service xml 中的ScanEnabled 属性即可 我想知道如何在 JBoss 7 上禁用此功能 Thanks 您只需删除部署扫描器子系统即可 Remove
  • docker中的GitLab CI docker无法创建卷

    我在 docker 中使用 docker 来托管我的容器 因为它们通过管道工作 我根据代码创建的容器设置为具有一个卷 用于将 gcloud 密钥传递到容器 这在我的本地计算机上完美运行 但在 gitlab runner 上它无法正确链接 从
  • 如何从 Dockerfile 安装 Python 3.7 和 Pip

    我正在尝试构建基于 Ubuntu 18 04 的自定义 Docker 映像 Ubuntu 预装了 Python 3 6 但我想 1 安装 Python 3 7 2 将其设置为默认 Python 版本 这样就可以使用python代替pytho
  • 如何让 Docker 容器在系统启动时自动启动?

    假设我有一个要运行的 Docker 容器 那么我可以调用 docker run 一切都很好 是否有一种内置方法可以在系统崩溃并重新启动时自动重新启动容器来运行容器 如果是这样 这在 Docker Compose 中也可用吗 是的 docke

随机推荐