0

I'm using ActiveMQ Artemis 2.20.0, and I require logs in JSON format.

I tried to use a JSON formatter in the logging.properties file but I get an error

The following is the change I made to logging.properties

# File handler configuration
handler.FILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler
handler.FILE.level=DEBUG
handler.FILE.properties=suffix,append,autoFlush,fileName
handler.FILE.suffix=.yyyy-MM-dd
handler.FILE.append=true
handler.FILE.autoFlush=true
handler.FILE.fileName=${artemis.instance}/log/artemis.log
handler.FILE.formatter=JSON

# Formatter pattern configuration
#formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
#formatter.PATTERN.properties=pattern
#formatter.PATTERN.pattern=%d %-5p [%c] %s%E%n

formatter.JSON=org.jboss.logmanager.formatters.JsonFormatter
formatter.JSON.properties=keyOverrides,metaData,prettyPrint,printDetails
formatter.JSON.constructorProperties=keyOverrides
formatter.JSON.keyOverrides=timestamp\=log_timestamp,level\=severity
formatter.JSON.metaData=@version\=1,service_id\=eric-eo-cm-cust-wf,json-format\=true
formatter.JSON.prettyPrint=false
formatter.JSON.printDetails=false

The stack trace of error is as follows:

No property "keyOverrides" type could be determined for formatter "JSON"Failed to read or configure the org.jboss.logmanager.LogManager
java.lang.IllegalArgumentException: Failed to instantiate class "org.jboss.logmanager.formatters.JsonFormatter" for formatter "JSON"
        at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:117)
        at org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:336)
        at org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:289)
        at org.jboss.logmanager.config.LogContextConfigurationImpl.commit(LogContextConfigurationImpl.java:298)
        at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:546)
        at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:97)
        at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:170)
        at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:132)
        at java.logging/java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:445)
        at java.logging/java.util.logging.LogManager$2.run(LogManager.java:394)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.logging/java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:382)
        at java.logging/java.util.logging.LogManager.getLogManager(LogManager.java:430)
        at java.logging/java.util.logging.Logger.demandLogger(Logger.java:648)
        at java.logging/java.util.logging.Logger.getLogger(Logger.java:717)
        at java.logging/java.util.logging.Logger.getLogger(Logger.java:701)
        at org.apache.activemq.artemis.boot.Artemis.<clinit>(Artemis.java:40)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:115)
        ... 16 more
Caused by: java.lang.NoClassDefFoundError: javax/json/Json
        at org.jboss.logmanager.formatters.JsonFormatter.<init>(JsonFormatter.java:76)
        ... 21 more

Does the ActiveMQ Artemis logging back-end have a JSON dependency to allow logs to format as JSON?

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • Hi Justin - I added the relevant part of logging.properties .. – Liamkelly15 Mar 10 '22 at 14:08
  • Hi Justin - I added more detail - It looks like the backend has no Json formatter – Liamkelly15 Mar 10 '22 at 14:18
  • apache activemq-artemis 2.20 – Liamkelly15 Mar 10 '22 at 14:54
  • Justin - which logging framework is artemis using ? – Liamkelly15 Mar 10 '22 at 14:58
  • ActiveMQ Artemis uses JBoss Logging as noted in [the documentation](https://activemq.apache.org/components/artemis/documentation/latest/logging.html). – Justin Bertram Mar 10 '22 at 15:09
  • I think JBoss Logging is an abstract..there will be a framework behind this – Liamkelly15 Mar 10 '22 at 15:10
  • JBoss Logging is not an abstract. It's a full log manager and logging implementation. Why do you think it is an abstract? – Justin Bertram Mar 10 '22 at 15:11
  • Reference https://docs.jboss.org/weld/reference/latest/en-US/html/logging.html – Liamkelly15 Mar 10 '22 at 15:13
  • From what I can tell "JBoss Logging" is the umbrella for both the logging framework (mentioned by the Weld documentation) _and_ the log manager. See [here](https://github.com/jboss-logging). In any case, ActiveMQ Artemis uses **both** the logging framework and log manager from JBoss Logging. – Justin Bertram Mar 10 '22 at 15:17
  • For what it's worth, the problem here isn't JBoss Logging. It's the `java.lang.NoClassDefFoundError: javax/json/Json` which means the JVM doesn't have the right jar(s) on the classpath. – Justin Bertram Mar 10 '22 at 15:21
  • Looking at the Github repo JBoss-logging can support all the frameworks (log4j , logback etc..) – Liamkelly15 Mar 10 '22 at 15:28
  • Of course the logging abstraction _can_ support multiple different managers, but ActiveMQ Artemis uses the [JBoss Log Manager](https://github.com/jboss-logging/jboss-logmanager) which is why you configure `logging.properties` with things like `org.jboss.logmanager.handlers.PeriodicRotatingFileHandler` and `org.jboss.logmanager.formatters.JsonFormatter`. – Justin Bertram Mar 10 '22 at 15:37
  • *Any* log manager that outputs JSON is likely to use `javax.json.Json` which means they would have the same classloading issue that the JBoss Log Manager is having in this case. – Justin Bertram Mar 10 '22 at 15:38
  • If no JSon library (like JACKSON) has been used in the backend then it will not matter about the framework ...maybe that explains why the classpath cannot find the jar files – Liamkelly15 Mar 10 '22 at 15:44

1 Answers1

1

This is ugly, but you need to:

  1. Download javax.json-1.1.jar. This is compatible with what JBoss Log Manager uses.

  2. Put javax.json-1.1.jar in to the lib directory of your Artemis' home directory (i.e. where you uncompressed the Artemis archive).

  3. Modify the bin/artemis script from the instance to include javax.json-1.1.jar in the -Xbootclasspath. There is already a line which includes a few jars (including the JBoss Log Manager) which you can modify, e.g.:

    exec "$JAVACMD" \
        $JAVA_ARGS \
        -Dhawtio.role="$HAWTIO_ROLE" \
        -Xbootclasspath/a:"$LOG_MANAGER:$WILDFLY_COMMON:$ARTEMIS_HOME/lib/javax.json-1.1.jar" \
        -Djava.security.auth.login.config="$ARTEMIS_INSTANCE_ETC/login.config" \
        $ARTEMIS_CLUSTER_PROPS \
        -classpath "$CLASSPATH" \
        -Dartemis.home="$ARTEMIS_HOME" \
        -Dartemis.instance="$ARTEMIS_INSTANCE" \
        -Djava.library.path="$ARTEMIS_HOME/bin/lib/linux-$(uname -m)" \
        -Djava.io.tmpdir="$ARTEMIS_INSTANCE/tmp" \
        -Ddata.dir="$ARTEMIS_DATA_DIR" \
        -Dartemis.instance.etc="$ARTEMIS_INSTANCE_ETC" \
        -Djava.util.logging.manager="$ARTEMIS_LOG_MANAGER" \
        -Dlogging.configuration="$ARTEMIS_LOGGING_CONF" \
        -Dartemis.default.sensitive.string.codec.key="$ARTEMIS_DEFAULT_SENSITIVE_STRING_CODEC_KEY" \
        $DEBUG_ARGS \
        org.apache.activemq.artemis.boot.Artemis "$@"
    

This is complicated because of the mess caused by Oracle not allowing Eclipse to use the javax namespace when Oracle donated Java EE to them. Everything named javax had to be renamed to jakarta for Jakarta EE 9 which has a lot of consequences. Since ActiveMQ Artemis can be embedded into both Java EE and Jarkata EE environments we need to be able to work no matter what JSON API is provided. Therefore, we wrapped the javax.json API with our own and then shaded both the API and the Apache Johnzon implementation into our distribution. See ARTEMIS-3546 for more details on that.

The problem with wrapping & shading is that external libraries like JBoss Logging Log Manager which might need javax.json don't have it which is why you need to add it manually. Hopefully this will be sorted out better in a future version of ActiveMQ Artemis.

Here's what the JSON looking looks like:

$ ./artemis run
     _        _               _
    / \  ____| |_  ___ __  __(_) _____
   / _ \|  _ \ __|/ _ \  \/  | |/  __/
  / ___ \ | \/ |_/  __/ |\/| | |\___ \
 /_/   \_\|   \__\____|_|  |_|_|/___ /
 Apache ActiveMQ Artemis 2.20.0


{"log_timestamp":"2022-03-10T13:38:27.241-06:00","sequence":0,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.integration.bootstrap","severity":"INFO","message":"AMQ101000: Starting ActiveMQ Artemis Server","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.267-06:00","sequence":2,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.289-06:00","sequence":4,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221012: Using AIO Journal","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.324-06:00","sequence":6,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 1,073,741,824","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.34-06:00","sequence":8,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.341-06:00","sequence":10,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.342-06:00","sequence":12,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.342-06:00","sequence":14,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for: MQTT","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.343-06:00","sequence":16,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding protocol support for: OPENWIRE","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.343-06:00","sequence":18,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.396-06:00","sequence":20,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221034: Waiting indefinitely to obtain live lock","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.397-06:00","sequence":22,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221035: Live Server Obtained live lock","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.574-06:00","sequence":24,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221080: Deploying address DLQ supporting [ANYCAST]","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.576-06:00","sequence":26,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221003: Deploying ANYCAST queue DLQ on address DLQ","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.581-06:00","sequence":28,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221080: Deploying address ExpiryQueue supporting [ANYCAST]","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.582-06:00","sequence":30,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221003: Deploying ANYCAST queue ExpiryQueue on address ExpiryQueue","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.85-06:00","sequence":32,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221020: Started NIO Acceptor at 0.0.0.0:61616 for protocols [CORE,MQTT,AMQP,STOMP,HORNETQ,OPENWIRE]","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.874-06:00","sequence":34,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221020: Started NIO Acceptor at 0.0.0.0:5445 for protocols [HORNETQ,STOMP]","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.878-06:00","sequence":36,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221020: Started NIO Acceptor at 0.0.0.0:5672 for protocols [AMQP]","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.909-06:00","sequence":38,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221020: Started NIO Acceptor at 0.0.0.0:1883 for protocols [MQTT]","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.914-06:00","sequence":40,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221020: Started NIO Acceptor at 0.0.0.0:61613 for protocols [STOMP]","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.916-06:00","sequence":42,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221007: Server is now live","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:27.917-06:00","sequence":44,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.20.0 [0.0.0.0, nodeID=f41aef33-a07b-11ec-aa6f-5c80b6f32172] ","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.1-06:00","sequence":46,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"org.apache.activemq.hawtio.branding.PluginContextListener","severity":"INFO","message":"Initialized activemq-branding plugin","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.124-06:00","sequence":47,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"org.apache.activemq.hawtio.plugin.PluginContextListener","severity":"INFO","message":"Initialized artemis-plugin plugin","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.276-06:00","sequence":48,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.hawt.HawtioContextListener","severity":"INFO","message":"Initialising hawtio services","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.292-06:00","sequence":49,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.hawt.system.ConfigManager","severity":"INFO","message":"Configuration will be discovered via system properties","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.294-06:00","sequence":50,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.hawt.jmx.JmxTreeWatcher","severity":"INFO","message":"Welcome to Hawtio 2.14.0","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.298-06:00","sequence":51,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.hawt.web.auth.AuthenticationConfiguration","severity":"INFO","message":"Starting hawtio authentication filter, JAAS realm: \"activemq\" authorized role(s): \"amq\" role principal classes: \"org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal\"","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.304-06:00","sequence":52,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.hawt.web.auth.LoginRedirectFilter","severity":"INFO","message":"Hawtio loginRedirectFilter is using 1800 sec. HttpSession timeout","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.315-06:00","sequence":53,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.hawt.web.proxy.ProxyServlet","severity":"INFO","message":"Proxy servlet is disabled","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.321-06:00","sequence":54,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.hawt.web.servlets.JolokiaConfiguredAgentServlet","severity":"INFO","message":"Jolokia overridden property: [key=policyLocation, value=file:/home/jbertram/java/artemis/apache-artemis-2.20.0/bin/jsonLogging/etc/jolokia-access.xml]","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.383-06:00","sequence":55,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis","severity":"INFO","message":"AMQ241001: HTTP Server started at http://localhost:8161","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.383-06:00","sequence":57,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis","severity":"INFO","message":"AMQ241002: Artemis Jolokia REST API available at http://localhost:8161/console/jolokia","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:28.383-06:00","sequence":59,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis","severity":"INFO","message":"AMQ241004: Artemis Console available at http://localhost:8161/console","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
^C{"log_timestamp":"2022-03-10T13:38:35.081-06:00","sequence":61,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.hawt.web.auth.AuthenticationFilter","severity":"INFO","message":"Destroying hawtio authentication filter","threadName":"shutdown-hook","threadId":14,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:35.084-06:00","sequence":62,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.hawt.HawtioContextListener","severity":"INFO","message":"Destroying hawtio services","threadName":"shutdown-hook","threadId":14,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:35.093-06:00","sequence":63,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"org.apache.activemq.hawtio.plugin.PluginContextListener","severity":"INFO","message":"Destroyed artemis-plugin plugin","threadName":"shutdown-hook","threadId":14,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:35.096-06:00","sequence":64,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"org.apache.activemq.hawtio.branding.PluginContextListener","severity":"INFO","message":"Destroyed activemq-branding plugin","threadName":"shutdown-hook","threadId":14,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
{"log_timestamp":"2022-03-10T13:38:35.11-06:00","sequence":65,"loggerClassName":"java.util.logging.Logger","loggerName":"org.apache.activemq.artemis.core.server","severity":"INFO","message":"AMQ221002: Apache ActiveMQ Artemis Message Broker version 2.20.0 [f41aef33-a07b-11ec-aa6f-5c80b6f32172] stopped, uptime 7.851 seconds","threadName":"shutdown-hook","threadId":14,"mdc":{},"ndc":"","hostName":"workhorse","processName":"Artemis","processId":1025544,"@version":"1","service_id":"eric-eo-cm-cust-wf","json-format":"true"}
Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • Hi Justin...can you show an extract from the bin/artemis with this added ... ? – Liamkelly15 Mar 10 '22 at 16:46
  • I updated my answer to address your comment. Hope that helps! – Justin Bertram Mar 10 '22 at 16:57
  • Ok Justin..my exec command is considerably shorter with far less - options - I do not have an existing -Xbootclasspath/a – Liamkelly15 Mar 10 '22 at 17:22
  • Hi Justin ... I did the above and confirmed the jar file was added but still get the error – Liamkelly15 Mar 10 '22 at 17:49
  • I created a fresh instance of ActiveMQ Artemis 2.20.0 and made the aforementioned changes and everything is working fine with your JSON-related updates in `logging.properties`. – Justin Bertram Mar 10 '22 at 18:56
  • Did you edit the artemis.sh after creating the broker instance ? I create the broker and then artemis run in the same script – Liamkelly15 Mar 10 '22 at 19:18
  • I think you're looking at the `artemis` script from the home directory, not the instance directory. I updated my answer to make this more clear. – Justin Bertram Mar 10 '22 at 19:24
  • Is there some way to take a paramater into the instance artemis.sh ... I cannot edit the instance artemis.sh ? I will just copy it into the instance before running – Liamkelly15 Mar 10 '22 at 19:30
  • The `bin/artemis` script doesn't support passing any parameters for specifying the Xbootclasspath. Why can't you edit the instance's `bin/artemis` script? – Justin Bertram Mar 10 '22 at 19:36
  • I copied the "edited" script in and it works - Thank you so much Justin – Liamkelly15 Mar 10 '22 at 19:47