Skip to content

Commit

Permalink
Fix/logging files (Blazemeter#48)
Browse files Browse the repository at this point in the history
* inc version blazemeter-api-client

* fix logging
  • Loading branch information
Artem Fedorov committed Mar 5, 2018
1 parent 5708272 commit 81d941a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -64,7 +64,7 @@
<dependency>
<groupId>com.blazemeter</groupId>
<artifactId>blazemeter-api-client</artifactId>
<version>1.5</version>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/blazemeter/BzmBuild.java
Expand Up @@ -141,7 +141,7 @@ public void interrupt(CiBuild build, Master master, PrintStream logger) {
}

private String createLogFile(FilePath workspace) throws IOException, InterruptedException {
FilePath logFile = workspace.child(Constants.BZM_LOG);
FilePath logFile = workspace.child(Constants.BZM_LOG + "-" + System.currentTimeMillis());
logFile.touch(System.currentTimeMillis());
return logFile.getRemote();
}
Expand Down
Expand Up @@ -27,6 +27,7 @@
* limitations under the License.
*/

import java.io.File;
import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
Expand All @@ -36,10 +37,12 @@
public class BzmJobLogger implements com.blazemeter.api.logging.Logger {

private Logger logger = Logger.getLogger(BzmJobLogger.class.getName());
private Logger fileLogger = Logger.getLogger("bzm-log");
private Logger fileLogger;
private FileHandler fileHandler;

public BzmJobLogger(String logFile) {
File f = new File(logFile);
this.fileLogger = Logger.getLogger(f.getName());
try {
fileHandler = new FileHandler(logFile);
} catch (IOException ex) {
Expand Down

0 comments on commit 81d941a

Please sign in to comment.