-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JBoss does not boot with jboss-logmanager-ecs-formatter configured #263
Comments
Hi, I am really not familiar with Jboss modules, but there is probably a way to allow a module to use the What happens here is that Jboss modules are loaded in an isolated classloader that filter what is allowed to access in the JDK, which is why you get a As an alternative, maybe using the library directly into your application instead of JBoss classloader could be a simpler option. |
Hi, Thank you very much for the tip: This: <?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.9" name="co.elastic.logging">
<resources>
<resource-root path="ecs-logging-core-1.6.0.jar"/>
<resource-root path="jboss-logmanager-ecs-formatter-1.6.0.jar"/>
</resources>
<dependencies>
<module name="org.jboss.logging"/>
<module name="java.logging"/>
</dependencies>
</module> Does not throw the exception any more. <periodic-rotating-file-handler name="ELASTIC" autoflush="true">
<filter-spec value="not(match("JBAS015960"))"/>
<formatter>
<named-formatter name="ECS"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="server.json"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler> The file is created but nothing is written into it: [jboss@jb7-1 log]$ ls -la server.json
-rw-r--r-- 1 jboss aplicacions 0 Jun 29 06:42 server.json I've modified standalone/configuration/standalone.xml as documented: <formatter name="ECS">
<custom-formatter module="co.elastic.logging" class="co.elastic.logging.jboss.logmanager.EcsFormatter" >
<properties>
<property name="serviceName" value="my-app"/>
<property name="serviceVersion" value="my-app-version"/>
<property name="serviceEnvironment" value="my-app-environment"/>
<property name="serviceNodeName" value="my-app-cluster-node"/>
</properties>
</custom-formatter>
</formatter> But log file is still 0 bytes, any thoughts? By the way, the documentation is also missing that you have to configure some JAVA options in standalone.conf: JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager"
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$(ls ${JBOSS_HOME}/modules/system/layers/base/org/wildfly/common/main/wildfly-common-*.jar)"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$(ls ${JBOSS_HOME}/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-*.jar)"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:${JBOSS_HOME}/jboss-modules.jar" |
Again, I have almost no expertise in Jboss logging, For the extra JVM options, those are very jboss/wildfly specific, so I am not sure how relevant they are in general to all jboss deployments. The most common use-case is to use those ECS loggers directly into the applications, not to deploy them globally on the server. When using the Elastic APM Java agent, the |
I have JBoss 7.4.15.
I've added the module as the documentation suggested:
modules/co/elastic/logging/main/module.xml
standalone/configuration/standalone.xml
JBoss won't boot:
Please help me, is there anything more to add to the module definition?
Thanks
The text was updated successfully, but these errors were encountered: