-
Book Overview & Buying
-
Table Of Contents
Apache OfBiz Cookbook
A handy debugging technique available to any OFBiz Java programmer at any time is to write messages to the OFBiz console log from within your program.
Firstly, ensure the following:
1. Make sure to import the OFBiz org.ofbiz.base.util.Debug utility into your Java program.
2. To ensure that your logfile entry is properly marked with the class name and line number from where it was called, check that the Java constant named module is defined within your class file as shown below:
public static final String module = MyClass.class.getName();
3. If you have turned off console window logging (the default out-of-the-box setting), make sure to return the startup file to its original setting to allow logging to the console window.
To always write to the console window, call the OFBiz Debug utility as shown:
import org.ofbiz.base.util.Debug;
// Code intentionally left out
Debug.log("This is an error message", module);
//Or, if you don't want to write...
Change the font size
Change margin width
Change background colour