Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Conflict with Spring cloud SpringApplication run

Open
#84 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
observability

Research direction

Start with FluentLoggerFactory around line 58 and inspect how FluentLogger sender lifecycle interacts with SpringApplication and BootstrapApplicationListener. Reproduce the NullPointerException in log(String tag, Map<String,Object> data, long timestamp), then add coverage for the null-sender case; done means repeated application startup no longer causes the failure.

Written by the indexing model from the issue text.

Description

Conflict with Spring cloud SpringApplication run. spring cloud because BootstrapApplicationListener.Causes Spring Application to execute many times.
and call FluentLogger stop. close sender, with sender is null.
then call log(String tag, Map<String, Object> data, long timestamp) function Throw out NullPointerException?
in FluentLoggerFactory 58 line add this code?

public synchronized FluentLogger getLogger(String tagPrefix, String host, int port, int timeout, int bufferCapacity,
            Reconnector reconnector) {
        String key = String.format("%s_%s_%d_%d_%d", new Object[] { tagPrefix, host, port, timeout, bufferCapacity });

        for (Map.Entry<FluentLogger, String> entry : loggers.entrySet()) {
            if (entry.getValue().equals(key)) {
                FluentLogger found = entry.getKey();
                if(found != null) {
                    if(found.getSender() == null){
                        found.setSender(getNewSender(host, port, timeout, bufferCapacity, reconnector));
                    }
                    return found;
                }
                break;
            }
        }


        FluentLogger logger = new FluentLogger(tagPrefix, getNewSender(host, port, timeout, bufferCapacity, reconnector));
        loggers.put(logger, key);
        return logger;
    }

private Sender getNewSender( String host, int port, int timeout, int bufferCapacity, Reconnector reconnector){
        Sender sender = null;
        Properties props = System.getProperties();
        if (!props.containsKey(Config.FLUENT_SENDER_CLASS)) {
            // create default sender object
            sender = new RawSocketSender(host, port, timeout, bufferCapacity, reconnector);
        } else {
            String senderClassName = props.getProperty(Config.FLUENT_SENDER_CLASS);
            try {
                sender = createSenderInstance(senderClassName, new Object[] { host, port, timeout, bufferCapacity });
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        return sender;
    }
Dominant language
Java
Stars
210
Forks
86
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

More from fluent/fluent-logger-java

All issues in fluent/fluent-logger-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.