Creating log handlers for debugging

When you are debugging an Endeca Server problem, it is useful to create a log handler that only handles Endeca Server loggers and writes to an individual log file.

The WLST configureLogHandler() command can add a log handler with a variety of options. The basic syntax (used in this topic) is shown by this example:
configureLogHandler(name="endeca-handler", addToLogger="com.endeca", path="c:/EndecaServer.log", 
   handlerType="oracle.core.ojdl.logging.ODLHandlerFactory", addHandler=1)
where:
  • name specifies the name of the new log handler.
  • addToLogger specifies the name of an existing logger to be added to this log handler.
  • path specifies the absolute path and name of the log file.
  • handlerType specifies the name of the Java class that provides the handler implementation.

    It must be an instance of java.util.logging.Handler or oracle.core.ojdl.logging.HandlerFactory.

  • addHandler is a Boolean value (1=true, 0=false). If the value is true, then the named handler will be added.

If you have an Endeca Server cluster, you can create the log handler on a specific machine by adding a target option to the command.

For more configureLogHandler() command options, see the WebLogic Scripting Tool Command Reference.

To add a new log handler:

  1. Make sure that WebLogic Server is running.
  2. From a command prompt, navigate to the $MW_HOME/oracle_common/common/bin directory.
  3. Start the WLST utility with the script for your operating system:
    • Linux: ./wlst.sh
    • Windows: wlst.cmd
  4. From within WLST, connect to WebLogic Server with your administrator username and password.

    For example:

    connect("weblogic", "welcome1")
  5. Use the setLogLevel() command to add a logger and set a log level for it.

    For example:

    setLogLevel(logger="com.endeca", level="FINER", addLogger=1)
  6. Use the configureLogHandler() command to create the log handler.

    See the example above for the syntax.

  7. Use the listLogHandlers command to verify that the log handler was created.

    For example:

    listLogHandlers(name="endeca-debug-handler")

    The command output should look similar to this:

    Handler Name: endeca-debug-handler
    type: ODL
    path: c:/temp/endeca-debug.log
  8. When you have finished, use the exit() command to exit the WLST utility.
If you later want to delete the debug log handler, use this WLST command:
configureLogHandler(name="endeca-debug-handler", removeFromLogger="com.endeca", removeHandler=1)
Note that because you cannot delete a log level, you should set the log level to a very coarse level. For example:
setLogLevel(logger="com.endeca", level="SEVERE")