您可以使用模式%h
在日誌文件中打印主機。例如(給出的缺省日誌配置):
/subsystem=logging/pattern-formatter=COLOR-PATTERN:write-attribute(name=pattern, value="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %h %s%e%n")
將打印日誌線像在控制檯上執行以下操作:
08:21:01,540 INFO [org.jboss.as.server] (Controller Boot Thread) localhost WFLYSRV0212: Resuming server
08:21:01,548 INFO [org.jboss.as] (Controller Boot Thread) localhost WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
08:21:01,549 INFO [org.jboss.as] (Controller Boot Thread) localhost WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
08:21:01,549 INFO [org.jboss.as] (Controller Boot Thread) localhost WFLYSRV0025: WildFly Core 3.0.0.Beta22-SNAPSHOT "Kenny" started in 93ms - Started 87 of 90 services (23 services are lazy, passive or on-demand)