Opentaps 2 Logging Service

From Opentaps Wiki

Jump to: navigation, search

opentaps 2 Logging Service

Logging in opentaps 2 is handled by log4j. The org.opentaps.core.log.Log has methods to log messages with OSGi standardized LogService service. There are 4 group of methods for 4 severity levels defined in LogService interface: debug, error, warning, info).

Log file can be found in <geronimoHome>/var/log/geronimo.log. Logging configurations are set in server-log4j.properties in the same directory. Currently by default the root logger is configured to INFO level and this mean all messages will appear in the log except those with DEBUG severity. For those of you familiar with opentaps v1, the "debug" level is comparable to Verbose from ofbiz.

To write to the log,

import org.opentaps.core.log.Log;

//...
        Log.logInfo("Note created with id [" + note.getId() + "]");

will show

2012-01-25 16:55:41,669 INFO  [core] Note created with id [31970A55CA89482BB6CF9F67F19B945B]


© 2008-2010 Open Source Strategies, Inc. Development of this documentation site is sponsored by Open Source Strategies, Inc.
Help support opentaps with a subscription to this documentation site.



Join our mailing list to learn more about opentaps Open Source ERP + CRM