-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from JNU-econovation/only_one_error_log
[UPDATE] Only one error log
- Loading branch information
Showing
11 changed files
with
104 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 1 addition & 19 deletions
20
...tructure/log-writer/src/main/java/com/whoz_in/log_writer/managed/mdns/MdnsLogProcess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,11 @@ | ||
package com.whoz_in.log_writer.managed.mdns; | ||
|
||
import com.whoz_in.log_writer.common.process.ContinuousProcess; | ||
import com.whoz_in.log_writer.common.util.NonBlockingBufferedReader; | ||
import com.whoz_in.log_writer.managed.ManagedInfo; | ||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
import java.io.OutputStreamWriter; | ||
import java.io.Writer; | ||
import java.lang.ProcessBuilder.Redirect; | ||
|
||
public class MdnsLogProcess extends ContinuousProcess { | ||
|
||
public MdnsLogProcess(ManagedInfo info, String sudoPassword) { | ||
try { | ||
super.process = new ProcessBuilder(info.command().split(" ")) | ||
.redirectError(Redirect.INHERIT) | ||
.start(); | ||
super.br = new NonBlockingBufferedReader(new BufferedReader(new InputStreamReader(this.process.getInputStream()))); | ||
Writer writer = new OutputStreamWriter(this.process.getOutputStream()); | ||
writer.write(sudoPassword + System.lineSeparator()); | ||
writer.flush(); | ||
} catch (IOException e) { | ||
|
||
throw new RuntimeException(info.command() + " 실행 실패"); | ||
} | ||
super(info.command(), sudoPassword); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 1 addition & 21 deletions
22
...astructure/log-writer/src/main/java/com/whoz_in/log_writer/monitor/MonitorLogProcess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,12 @@ | ||
package com.whoz_in.log_writer.monitor; | ||
|
||
import com.whoz_in.log_writer.common.process.ContinuousProcess; | ||
import com.whoz_in.log_writer.common.util.NonBlockingBufferedReader; | ||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
import java.io.OutputStreamWriter; | ||
import java.io.Writer; | ||
import java.lang.ProcessBuilder.Redirect; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
public final class MonitorLogProcess extends ContinuousProcess { | ||
|
||
public MonitorLogProcess(MonitorInfo info, String sudoPassword) { | ||
try { | ||
super.process = new ProcessBuilder(info.command().split(" ")) | ||
.redirectError(Redirect.INHERIT) | ||
.start(); | ||
super.br = new NonBlockingBufferedReader(new BufferedReader(new InputStreamReader(process.getInputStream()))); | ||
|
||
Writer writer = new OutputStreamWriter(process.getOutputStream()); | ||
writer.write(sudoPassword + System.lineSeparator()); | ||
writer.flush(); | ||
} catch (IOException e) { | ||
String message = info.command() + " 실행 실패"; | ||
log.error(message); | ||
throw new RuntimeException(message); | ||
} | ||
super(info.command(), sudoPassword); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters