I'm a beginner with wildfly logging and I'm trying to add more information in the log generated by Jboss, like the Hostname (instead of the ip adress)
I'm using Wildfly 10 with the jboss-logmanager-ext who sent logs to logstash 6.7.1 each one in a docker container
jboss-logmanager-ext-1.0.0.Alpha5.jar is added inside Wildfly using CLI, here is the logstash formatter line :
# Add the logstash formatter
/subsystem=logging/custom-formatter=logstash:add(class=org.jboss.logmanager.ext.formatters.LogstashFormatter,module=org.jboss.logmanager.ext)
Actually my log looks like that :
{
"host" => "172.17.0.3",
"port" => 46176,
"message" => "...",
"@version" => "1",
"@timestamp" => 2019-04-09T10:07:57.354Z
}
I want to add a field hostname and perhaps other things later, is it possible without adding a new module to do a custom pattern ? with XML file or other ? I have only find external module like Logstash/Gelf
You could try adding the jboss.qualified.host.name
or jboss.home.name
system properties.
/subsystem=logging/custom-handler=logstash:write-attribute(value=meta-data, value={"qualifiedHost=${jboss.qualified.host.name}"})