Fix log issue when initializtion.

This commit is contained in:
wusheng 2017-10-15 08:50:51 +08:00
parent eb50749694
commit ef88a2ac32
2 changed files with 7 additions and 1 deletions

View File

@ -34,4 +34,8 @@ public enum SystemOutWriter implements IWriter {
PrintStream out = System.out;
out.println(message);
}
public PrintStream getStream(){
return System.out;
}
}

View File

@ -27,6 +27,7 @@ import net.bytebuddy.utility.JavaModule;
import org.skywalking.apm.agent.core.boot.ServiceManager;
import org.skywalking.apm.agent.core.conf.SnifferConfigInitializer;
import org.skywalking.apm.agent.core.logging.EasyLogResolver;
import org.skywalking.apm.agent.core.logging.SystemOutWriter;
import org.skywalking.apm.agent.core.plugin.AbstractClassEnhancePluginDefine;
import org.skywalking.apm.agent.core.plugin.EnhanceContext;
import org.skywalking.apm.agent.core.plugin.PluginBootstrap;
@ -66,7 +67,8 @@ public class SkyWalkingAgent {
ServiceManager.INSTANCE.boot();
} catch (Exception e) {
logger.error(e, "skywalking agent shutdown.");
SystemOutWriter.INSTANCE.write("skywalking agent is shutting down.");
e.printStackTrace(SystemOutWriter.INSTANCE.getStream());
return;
}