Wednesday, March 23, 2011

100% height page in IE8

I set body and html to 100% height and then an inner container element to min-height: 100%

This worked in Chrome and Firefox but in IE8 the container element was not stretching to the bottom of the page.

Eventually I found that the GWT date picker widget and photo viewer on the page were not being included in the height of the page.  By setting a specific height on these elements (reserving the space) IE displays the page correctly.  It also makes the page load look smoother.

Tuesday, March 22, 2011

AppEngine logging level

I tried to change the logging level in my Google App Engine app to FINE to see what was happening in Sitebricks.  I edited the /WEB-INF/logging.properties file to read:

.level = INFO
com.google.sitebricks.level = FINE 
 But still only WARN messages were logged to the console.

Finally I realised that on the launcher dialogue panel for GWT I had to also set the level to DEBUG.  But when I did that the console was flooded with GWT compile messages.  This is due to a new bug in GAE's logging where it tries to use the same settings as GWT but gives you no control of the GWT part.

So I installed a simple logging handler to get around this:


Put this in app init
if (isDevelopment()) { Logger.getLogger("").addHandler(new WorkaroundHander()); }
public boolean isDevelopment() { return System.getProperty("com.google.appengine.runtime.environment").equals("Development"); }
private static class WorkaroundHander extends Handler { public WorkaroundHander() { setFormatter(new TextLogFormatter(false)); setLevel(Level.ALL); }
@Override public void publish(LogRecord record) { if (isLoggable(record)) { System.out.println(getFormatter().format(record)); } } 
@Override public void flush() { } @Override public void close() throws SecurityException { } }


Now I I happily see all the FINE messages that Sitebricks has for me.