Logger not printing?

Hello again,

I use context.getExecutionManager to create the execution manager “exe”, and HeartBeatDetector (listen for heartbeat every 30sec) which implements Runnable interface:

[code] public void beginRestart() {
logger.warn("Beginning reconnect to antenna: " + name);
exe.unRegister(“heartbeat monitor”,“heartbeat name”); //temporarily stop seeking a heartbeat

public void restart(){//attempt to connect to the LRS again with the same info

	logger.warn("Attempting to reconnect to antenna " + name);


		clientSocket = new Socket(ip_address, port);
		outToServer = new DataOutputStream(clientSocket.getOutputStream());
		inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
		clientSocket.setSoTimeout(2000);//reads will only wait 2 seconds before throwing a timeout exception
				"<Login user=\"anon\" "
						+"passwd=\"anon\" "
						+"services=\"NetPage:2.0;Config:1.0;Heartbeat:1.0\"/>" + "\n\r");

		heartbeat= new HeartbeatDetector(inFromServer, name, this);
		logger.info("Successfully reconnected to antenna: "+name);
		exe.register("heartbeat monitor","heartbeat name",heartbeat, 30000); //re-register the heartbeat task on successful connection
		return; //successfully reconnected
	}catch(Exception e){
		logger.error("Unable to restart connection to antenna " + name + ". "+e.toString());
		restart();//failed to reconnect, try again

but the problem is that some of the logger prints are not showing up in the logs.

Basically, the code itself works (continuously try to reconnect to the hardware until the connection becomes available again), but some of the logger prints are not showing up in the logger (as shown in attached image). Also, the logs are appearing out of order (Heartbeat should timeout first, then antenna should reconnect)

Could this have something to do with the execution manager? Why could this be this happening?

System.out.println() doesn’t go to the logs you see in the gateway. It’s not going through the logging systems, it’s going straight to stdout. You should be able to see those messages in the wrapper.log files.

Yes I understand that. It’s old code I haven’t yet removed. However I’m not concerned with the System.out.print, rather some of the logger.info, logger.warn, and logger.error calls are not being displayed while others are.

For example, in my attached image the connection is lost and then regained after calling restart() a couple times. However, even though it successfully connected, it did not display “Successfully reconnected to antenna: Antenna 1” as it should have.

I’d make sure that the code you think is running is really running before second guessing the logging system… I’m not really sure there’s much room for error there and I’ve never seen any issues like that before.

If you haven’t set up remote debugging yet, give that a shot: docs.inductiveautomation.com:84 … n+IntelliJ

The important part of configuration is the bit about modifying ignition.conf and restarting the gateway. Running a remote app in Eclipse (if that’s what you’re using) is similar: docs.inductiveautomation.com:84 … /Debugging

Thanks for the help :slight_smile: