pulumi / pulumi/pulumi-java

Using Pulumi with JBoss Logging breaks the logging framework

Open
#1,745 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area/automation-api kind/bug
Dominant language
Java
Stars
85
Forks
26
Avg merge
11h 49m
Merged PRs (30d)
22

Description

What happened?

When using the JBoss logging framework in combination with Pulumi, JBoss logging stops working after any LocalPulumiCommand is executed.

In the following example, I print to the console in 3 different ways:

  • Using System.out.println
  • Using logger.info
  • Using logger.error

I have logging statements labelled "a" to "e". What I observe is the following:

  • a is printed 3 times
  • b is printed 3 times
  • c is printed 3 times
  • d is printed 2 (!) times
  • e is printed 2 (!) times

After calling stack.preview(...) JBoss's logger.info stops working, everywhere in my application!

Example

Gradle deps

    implementation("org.jboss.logging:jboss-logging:3.6.1.Final")
    implementation("com.pulumi:pulumi:1.6.0")
    implementation("com.pulumi:gitlab:8.10.0")

Example code

public class Main {
    private static final String token = "...";
    private static final Logger logger = Logger.getLogger(Main.class);

    public static void main(String[] args) {
        System.out.println("a");
        logger.info("a");
        logger.error("a");

        LocalWorkspaceOptions options = LocalWorkspaceOptions.builder()
                .projectSettings(ProjectSettings.builder("test", ProjectRuntime.builder(ProjectRuntimeName.JAVA).build())
                        .build())
                .environmentVariables(Map.of(
                        "PULUMI_CONFIG_PASSPHRASE", ""
                ))
                .build();

        System.out.println("b");
        logger.info("b");
        logger.error("b");

        try(var stack = LocalWorkspace.createOrSelectStack("test", "test", Main::create, options)) {
            stack.workspace().installPlugin("gitlab", "v8.10.0");
            stack.setConfig("gitlab:token", new ConfigValue(token));

            System.out.println("c");
            logger.info("c");
            logger.error("c");

            stack.preview(PreviewOptions.builder()
                    .build());

            System.out.println("d");
            logger.info("d");
            logger.error("d");

            stack.up();

            System.out.println("e");
            logger.info("e");
            logger.error("e");
        } catch (Exception e) {
            System.out.println(e.getMessage());
            logger.error(e.getMessage(), e);
            throw new RuntimeException(e);
        }
    }

    public static void create(Context context) {
        new Group("test", GroupArgs.builder()
            .name("test")
            .path("test")
            .parentId(12345)
            .build());
    }
}
Output of pulumi about

CLI
Version 3.158.0
Go Version go1.24.1
Go Compiler gc

Host
OS ubuntu
Version 24.04
Arch x86_64

Backend
Name p15v
URL file://~
User briansetz
Organizations
Token type personal

Pulumi locates its logs in /tmp by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Java example with JBoss Logging, Pulumi, and the GitLab dependency, focusing on the LocalPulumiCommand and stack.preview(...) call. Trace when logging stops working after preview, then verify that logger.info continues to emit messages after preview and up complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.