Confusion regarding nifty GUI threads

I removed all the BasicConfigurator.Configure() from all appstates and its working flawlessly now…
Nifty hsa nothing to do with it as I tried disabling all its functions and it still was displaying the logs each time

@simar.i3r said: I removed all the BasicConfigurator.Configure() from all appstates and its working flawlessly now... Nifty hsa nothing to do with it as I tried disabling all its functions and it still was displaying the logs each time

Yeah, that’s why I asked… because every time you call BasicConfigurator.configure you setup new appenders, etc. in addition to the existing ones.

@jmaasing said: And again, is your appstate the screen controller? How do you specify the screen controller in the XML? Do you register the screen controller before adding the XML-file?

Show us code or we will go around in circles forever.

Note: once I saw the log messages and how they all had the exact same time, I sort of ruled this reason out (though it was a good potential reason)… that’s the only reason I didn’t continue peeling that one back.

The statistical likelihood that nifty would be calling through to his code and then the logger at the exact same time every time was unlikely (I think it’s milliseconds so it is theoretically possible). But in log4j, the message itself is created once and passed to all of the appenders and so they will have identical times if logging is configured to output multiple times.

@pspeed said: Note: once I saw the log messages and how they all had the exact same time, I sort of ruled this reason out (though it was a good potential reason)... that's the only reason I didn't continue peeling that one back.

The statistical likelihood that nifty would be calling through to his code and then the logger at the exact same time every time was unlikely (I think it’s milliseconds so it is theoretically possible). But in log4j, the message itself is created once and passed to all of the appenders and so they will have identical times if logging is configured to output multiple times.

Oh yes, I was a bit unclear, sorry, that’s why I said “So if you set up logging in the constructor of the screen controller” - it must have been appenders that got set up several times. Not the same log-statement executed several times since as you say they are identical lines repeated.

So yeah, removing “BasicConfigurator.Configure()” removed logging - I still think the same constructor is called several times :slight_smile:

@jmaasing said: Oh yes, I was a bit unclear, sorry, that's why I said "So if you set up logging in the constructor of the screen controller" - it must have been appenders that got set up several times. Not the same log-statement executed several times since as you say they are identical lines repeated.

So yeah, removing “BasicConfigurator.Configure()” removed logging - I still think the same constructor is called several times :slight_smile:

He was running that from every class that used logging, I guess. Which is why the number of log messages grew over time to the full 6 he was eventually getting.