mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Merge pull request #6285 from jmacxx/tor_log_level
Set Tor logging to DEBUG level at startup
This commit is contained in:
commit
2561de9951
@ -79,6 +79,12 @@ public class Log {
|
||||
((Logger) LoggerFactory.getLogger(pattern)).setLevel(logLevel);
|
||||
}
|
||||
|
||||
public static String pushCustomLogLevel(String pattern, String logLevel) {
|
||||
Level oldLevel = ((Logger) LoggerFactory.getLogger(pattern)).getLevel();
|
||||
((Logger) LoggerFactory.getLogger(pattern)).setLevel(Level.toLevel(logLevel));
|
||||
return oldLevel == null ? "INFO" : oldLevel.toString();
|
||||
}
|
||||
|
||||
public static void filterByThreadName(String threadName) {
|
||||
logbackLogger.getLoggerContext().addTurboFilter(new TurboFilter() {
|
||||
@Override
|
||||
|
@ -22,6 +22,7 @@ import bisq.network.utils.Utils;
|
||||
|
||||
import bisq.common.Timer;
|
||||
import bisq.common.UserThread;
|
||||
import bisq.common.app.Log;
|
||||
import bisq.common.proto.network.NetworkProtoResolver;
|
||||
import bisq.common.util.Utilities;
|
||||
|
||||
@ -208,6 +209,8 @@ public class TorNetworkNode extends NetworkNode {
|
||||
private void createTorAndHiddenService(int localPort, int servicePort) {
|
||||
torStartupFuture = executorService.submit(() -> {
|
||||
try {
|
||||
// temporarily switch tor to debug logging
|
||||
String savedLogLevel = Log.pushCustomLogLevel("org.berndpruenster.netlayer", "DEBUG");
|
||||
// get tor
|
||||
Tor.setDefault(torMode.getTor());
|
||||
|
||||
@ -222,6 +225,8 @@ public class TorNetworkNode extends NetworkNode {
|
||||
"Tor hidden service published after {} ms. Socket={}\n" +
|
||||
"################################################################",
|
||||
(new Date().getTime() - ts2), socket); //takes usually 30-40 sec
|
||||
// tor has started, revert from debug to original log level
|
||||
Log.pushCustomLogLevel("org.berndpruenster.netlayer", savedLogLevel);
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
Loading…
Reference in New Issue
Block a user