Logging
The purpose of this post is to help you better understand how iDempiere works through the use of logging. There is not question that logging is one of the easiest and fastest ways to understand how yours or someone else's code actually works.
Log Level
Go here to learn more about setting the server's and swing client's log level.
CLogger
CLogger is iDempiere's logging object. In much of the code that you will write, a CLogger object already exists with an object name of "log". Writing processes is a good example. Your process class will extend SvrProcess. SvrProcess has a CLogger with a variable name of "log". GLJournalGenerate.java is a good example of a process that uses logs.
Here is an example of creating a log statement:
if (log.isLoggable(Level.INFO)) log.info("Journal_Generator_ID=" + p_JournalGenerator_ID);
New CLogger
If you are writing a class that does not have access to a CLogger, simply create one.
protected CLogger log = CLogger.getCLogger (getClass());
Feedback
Please post a comment to the bottom of this page or send an email to chuboe-id-training@googlegroups.com with how this page can be improved. Thanks!!