Conflict with Spring cloud SpringApplication run
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fluent/fluent-logger-java
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
fluent/fluent-logger-java#100 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
fluent/fluent-logger-java#99 · 1 comment · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
fluent/fluent-logger-java#98 · 1 comment ·
-
Null Pointer Exception with slf4j-log4j12-1.7.30 (Fluent-logger incompatible with the new version) Open
Difficulty 3/5 1-2 days Newbie friendliness 42/100
fluent/fluent-logger-java#89 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
fluent/fluent-logger-java#88 · 1 comment ·
All issues in fluent/fluent-logger-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
elastic/gradle-plugins#157 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cryptomator/hub#497 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
johanhaleby/occurrent#1120 ·