Dashboard > WebObjects > EOF-Using EOF-Logging
  WebObjects Log In View a printable version of the current page.  
  EOF-Using EOF-Logging
Added by Steven Mark McCraw, last edited by Pascal Robert on Sep 03, 2007  (view change)
Labels: 
(None)

Overview

You can turn SQL logging on when launching by using -DEOAdaptorDebugEnabled=true or EOAdaptorDebugEnabled YES. However, this can slam out a ton of SQL. While this is useful for some debugging it is way too much to sift through when trying to analyze a particular problem.

You can use this method to selectively enable and disable SQL logging:

public static void logSQL(boolean shouldLog) {
  if (shouldLog) {
      NSLog.allowDebugLoggingForGroups(NSLog.DebugGroupSQLGeneration |
                                       NSLog.DebugGroupDatabaseAccess |
                                       NSLog.DebugGroupEnterpriseObjects);
  } else {
      NSLog.refuseDebugLoggingForGroups(NSLog.DebugGroupSQLGeneration |
                                        NSLog.DebugGroupDatabaseAccess |
                                        NSLog.DebugGroupEnterpriseObjects);
  }
}

This can be useful for such things as determining what fetches are performed when a page is rendered:

public void appendToResponse(WOResponse aResponse,
                           WOContext aContext) {
  logSQL(true);
  super.appendToResponse(aResponse, aContext);
  logSQL(false);
}

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators