Skip to content

Commit

Permalink
[FIXED JENKINS-15226] Log recorders do not work reliably.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Sep 19, 2012
1 parent 991072b commit f9583b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Log recorders do not work reliably.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-15226">issue 15226</a>)
<li class=>
</ul>
</div><!--=TRUNK-END=-->
Expand Down
6 changes: 5 additions & 1 deletion core/src/main/java/hudson/logging/LogRecorder.java
Expand Up @@ -87,6 +87,7 @@ public void publish(LogRecord record) {
public static final class Target {
public final String name;
private final int level;
private transient /* almost final*/ Logger logger;

public Target(String name, Level level) {
this(name,level.intValue());
Expand Down Expand Up @@ -118,7 +119,10 @@ public boolean includes(LogRecord r) {
}

public Logger getLogger() {
return Logger.getLogger(name);
if (logger == null) {
logger = Logger.getLogger(name);
}
return logger;
}

/**
Expand Down

0 comments on commit f9583b8

Please sign in to comment.