Configuring an `exception-output-type` in the logging\json-formatter breaks logging exceptions

19 views
Skip to first unread message

Edgar Vonk

unread,
Mar 31, 2026, 8:29:58 AM (11 days ago) Mar 31
to WildFly
We have configured our WildFly (bootable JAR) application to use JSON structured logging. We notice however that when setting the `exception-output-type` attribute (to any value), that no exceptions are logged at all anymore. Normal log messages are still logged fine.
Without setting the `exception-output-type` attribute both exceptions and normal messages are logged just fine (and in JSON).

Could this be a bug, or is this intended behavior, or a some misconfiguration on our side maybe? 

Excerpt from our WildFly configuration CLI script:

```
# Configure JSON log output format for structured logging.
# This enables log aggregation tools to parse and index log messages including any added log context.
# Note: `exception-output-type` is intentionally not set.
# Setting it to any value (`formatted`, `detailed`, or `detailed-and-formatted`) results in WildFly silently dropping all log records containing exceptions.
# The default behaviour already includes exception details in the JSON output.
/subsystem=logging/json-formatter=JSON:add( \
    pretty-print=false, \
    meta-data={ \
        "service"=>"zac" \
    } \
)
/subsystem=logging/console-handler=CONSOLE:write-attribute(name=named-formatter, value=JSON)
```

Edgar Vonk

unread,
Mar 31, 2026, 8:34:33 AM (11 days ago) Mar 31
to WildFly
Forgot to mention: we are using WildFly 39.0.0 Final.

James Perkins

unread,
Apr 10, 2026, 1:03:30 PM (23 hours ago) Apr 10
to WildFly
Sorry for the late reply, I thought I had already sent it :)

The default should be detailed so you should get the stack trace in a key of "exception". I used pretty printing for my example so it's easier to read:

{
    "timestamp": "2026-04-10T10:01:57.117-07:00",
    "sequence": 110,
    "loggerClassName": "org.jboss.logging.Logger",
    "loggerName": "dev.resteasy.examples.resources.ErrorResource",
    "level": "ERROR",
    "message": "Logged error with stack trace",
    "threadName": "default task-2",
    "threadId": 380,
    "mdc": {
    },
    "ndc": "",
    "hostName": "stalefish",
    "processName": "/usr/lib/jvm/java-25-openjdk/bin/java",
    "processId": 2904098,
    "exception": {
        "refId": 1,
        "exceptionType": "java.lang.RuntimeException",
        "message": "Created for testing",
        "frames": [
            {
                "class": "dev.resteasy.examples.resources.ErrorResource",
                "method": "produceStackTrace",
                "line": 37
            },
            {
                "class": "dev.resteasy.examples.resources.ErrorResource$Proxy$_$$_WeldClientProxy",
                "method": "produceStackTrace"
            },
            {
                "class": "jdk.internal.reflect.DirectMethodHandleAccessor",
                "method": "invoke",
                "line": 104
            },
            {
                "class": "java.lang.reflect.Method",
                "method": "invoke",
                "line": 565
            },
            {
                "class": "org.jboss.resteasy.core.MethodInjectorImpl",
                "method": "invoke",
                "line": 154
            },
            {
                "class": "org.jboss.resteasy.core.MethodInjectorImpl",
                "method": "invoke",
                "line": 118
            },
            {
                "class": "org.jboss.resteasy.core.ResourceMethodInvoker",
                "method": "internalInvokeOnTarget",
                "line": 560
            },
            {
                "class": "org.jboss.resteasy.core.ResourceMethodInvoker",
                "method": "invokeOnTargetAfterFilter",
                "line": 452
            },
            {
                "class": "org.jboss.resteasy.core.ResourceMethodInvoker",
                "method": "lambda$invokeOnTarget$2",
                "line": 413
            },
            {
                "class": "org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext",
                "method": "filter",
                "line": 321
            },
            {
                "class": "org.jboss.resteasy.core.ResourceMethodInvoker",
                "method": "invokeOnTarget",
                "line": 415
            },
            {
                "class": "org.jboss.resteasy.core.ResourceMethodInvoker",
                "method": "invoke",
                "line": 378
            },
            {
                "class": "org.jboss.resteasy.core.ResourceMethodInvoker",
                "method": "invoke",
                "line": 356
            },
            {
                "class": "org.jboss.resteasy.core.ResourceMethodInvoker",
                "method": "invoke",
                "line": 70
            },
            {
                "class": "org.jboss.resteasy.core.SynchronousDispatcher",
                "method": "invoke",
                "line": 429
            },
            {
                "class": "org.jboss.resteasy.core.SynchronousDispatcher",
                "method": "lambda$invoke$4",
                "line": 240
            },
            {
                "class": "org.jboss.resteasy.core.SynchronousDispatcher",
                "method": "lambda$preprocess$0",
                "line": 154
            },
            {
                "class": "org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext",
                "method": "filter",
                "line": 321
            },
            {
                "class": "org.jboss.resteasy.core.SynchronousDispatcher",
                "method": "preprocess",
                "line": 157
            },
            {
                "class": "org.jboss.resteasy.core.SynchronousDispatcher",
                "method": "invoke",
                "line": 229
            },
            {
                "class": "org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher",
                "method": "service",
                "line": 222
            },
            {
                "class": "org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher",
                "method": "service",
                "line": 55
            },
            {
                "class": "org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher",
                "method": "service",
                "line": 51
            },
            {
                "class": "jakarta.servlet.http.HttpServlet",
                "method": "service",
                "line": 614
            },
            {
                "class": "io.undertow.servlet.handlers.ServletHandler",
                "method": "handleRequest",
                "line": 74
            },
            {
                "class": "io.undertow.servlet.handlers.security.ServletSecurityRoleHandler",
                "method": "handleRequest",
                "line": 62
            },
            {
                "class": "io.undertow.servlet.handlers.ServletChain$1",
                "method": "handleRequest",
                "line": 68
            },
            {
                "class": "io.undertow.servlet.handlers.ServletDispatchingHandler",
                "method": "handleRequest",
                "line": 36
            },
            {
                "class": "org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler",
                "method": "lambda$handleRequest$1",
                "line": 68
            },
            {
                "class": "org.wildfly.security.auth.server.FlexibleIdentityAssociation",
                "method": "runAsFunctionEx",
                "line": 103
            },
            {
                "class": "org.wildfly.security.auth.server.Scoped",
                "method": "runAsFunctionEx",
                "line": 161
            },
            {
                "class": "org.wildfly.security.auth.server.Scoped",
                "method": "runAs",
                "line": 73
            },
            {
                "class": "org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler",
                "method": "handleRequest",
                "line": 67
            },
            {
                "class": "io.undertow.servlet.handlers.RedirectDirHandler",
                "method": "handleRequest",
                "line": 68
            },
            {
                "class": "io.undertow.servlet.handlers.security.SSLInformationAssociationHandler",
                "method": "handleRequest",
                "line": 117
            },
            {
                "class": "io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler",
                "method": "handleRequest",
                "line": 57
            },
            {
                "class": "io.undertow.server.handlers.PredicateHandler",
                "method": "handleRequest",
                "line": 43
            },
            {
                "class": "io.undertow.security.handlers.AbstractConfidentialityHandler",
                "method": "handleRequest",
                "line": 46
            },
            {
                "class": "io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler",
                "method": "handleRequest",
                "line": 64
            },
            {
                "class": "io.undertow.security.handlers.AbstractSecurityContextAssociationHandler",
                "method": "handleRequest",
                "line": 43
            },
            {
                "class": "org.wildfly.elytron.web.undertow.server.servlet.CleanUpHandler",
                "method": "handleRequest",
                "line": 38
            },
            {
                "class": "io.undertow.server.handlers.PredicateHandler",
                "method": "handleRequest",
                "line": 43
            },
            {
                "class": "org.wildfly.extension.undertow.deployment.ControlPointDeploymentInfoConfigurator$ControlPointRequestAttributeHandler",
                "method": "handleRequest",
                "line": 175
            },
            {
                "class": "org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler",
                "method": "handleRequest",
                "line": 44
            },
            {
                "class": "io.undertow.server.handlers.PredicateHandler",
                "method": "handleRequest",
                "line": 43
            },
            {
                "class": "io.undertow.servlet.handlers.SendErrorPageHandler",
                "method": "handleRequest",
                "line": 52
            },
            {
                "class": "io.undertow.server.handlers.PredicateHandler",
                "method": "handleRequest",
                "line": 43
            },
            {
                "class": "io.undertow.servlet.handlers.ServletInitialHandler",
                "method": "handleFirstRequest",
                "line": 271
            },
            {
                "class": "io.undertow.servlet.handlers.ServletInitialHandler$1",
                "method": "call",
                "line": 130
            },
            {
                "class": "io.undertow.servlet.handlers.ServletInitialHandler$1",
                "method": "call",
                "line": 127
            },
            {
                "class": "io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1",
                "method": "call",
                "line": 48
            },
            {
                "class": "io.undertow.servlet.core.ContextClassLoaderSetupAction$1",
                "method": "call",
                "line": 43
            },
            {
                "class": "org.wildfly.extension.undertow.deployment.ControlPointDeploymentInfoConfigurator$1",
                "method": "call",
                "line": 100
            },
            {
                "class": "org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction",
                "method": "lambda$create$0",
                "line": 1431
            },
            {
                "class": "org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction",
                "method": "lambda$create$0",
                "line": 1431
            },
            {
                "class": "org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction",
                "method": "lambda$create$0",
                "line": 1431
            },
            {
                "class": "org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction",
                "method": "lambda$create$0",
                "line": 1431
            },
            {
                "class": "io.undertow.servlet.handlers.ServletInitialHandler",
                "method": "dispatchRequest",
                "line": 251
            },
            {
                "class": "io.undertow.servlet.handlers.ServletInitialHandler",
                "method": "lambda$new$1",
                "line": 99
            },
            {
                "class": "io.undertow.server.Connectors",
                "method": "executeRootHandler",
                "line": 418
            },
            {
                "class": "io.undertow.server.HttpServerExchange$1",
                "method": "run",
                "line": 938
            },
            {
                "class": "org.jboss.threads.ContextHandler$1",
                "method": "runWith",
                "line": 18
            },
            {
                "class": "org.jboss.threads.EnhancedQueueExecutor$Task",
                "method": "doRunWith",
                "line": 2651
            },
            {
                "class": "org.jboss.threads.EnhancedQueueExecutor$Task",
                "method": "run",
                "line": 2630
            },
            {
                "class": "org.jboss.threads.EnhancedQueueExecutor",
                "method": "runThreadBody",
                "line": 1622
            },
            {
                "class": "org.jboss.threads.EnhancedQueueExecutor$ThreadBody",
                "method": "run",
                "line": 1589
            },
            {
                "class": "org.xnio.XnioWorker$WorkerThreadFactory$1$1",
                "method": "run",
                "line": 1282
            },
            {
                "class": "java.lang.Thread",
                "method": "run",
                "line": 1474
            }
        ]
    },
    "service": "zac"
}


Reply all
Reply to author
Forward
0 new messages