Python logging package is used to log from Plone.
By default, logs go to var/log/instance.log. If Zope instance is started in the foreground mode logs will be printed in the console (stdout) too.
Default log level is INFO. To enable more verbose logging, edit buildout.cfg, change log level by editing [instance] section event-log-level.
Example:
import logging
logger = logging.getLogger("Plone")
class MySomething(object):
...
def function(self):
logger.info("Reached function()")
...
Python logging module doesn’t provide Zope 2 security assertations. Python script plone_log exposes logging for sandboxed environments.
Example:
context.plone_log("This is so fun")