'Log something important using the CEF library.
Parameters:
**environ**
Typically a Django request object. It can also be
a plain dict.
**app**
An app/addon object.
**msg**
A short message about the incident.
**longer**
A more description message about the incident.
**severity=None**
A 0-10 int to override the default severity.
**extra_kwargs**
A dict to override anything sent to the CEF library.'

def log(self, environ, app, msg, longer, severity=None, extra_kwargs=None):

    c = {'cef.product': getattr(settings, 'CEF_PRODUCT', 'AMO'), 'cef.vendor': getattr(settings, 'CEF_VENDOR', 'Mozilla'), 'cef.version': getattr(settings, 'CEF_VERSION', '0'), 'cef.device_version': getattr(settings, 'CEF_DEVICE_VERSION', '0'), 'cef.file': getattr(settings, 'CEF_FILE', 'syslog')}
    user = getattr(environ, 'user', None)
    try:
        app_str = app.pk
    except AttributeError:
        app_str = app
    kwargs = {'username': getattr(user, 'name', ''), 'suid': str(getattr(user, 'pk', '')), 'signature': ('%s%s' % (self.sig_prefix, msg.upper())), 'msg': longer, 'config': c, 'cs2': app_str, 'cs2Label': self.cs2label}
    if extra_kwargs:
        kwargs.update(extra_kwargs)
    if (not severity):
        severity = self.default_severity
    if (not severity):
        raise ValueError('CEF    severity    was    not    defined')
    if isinstance(environ, HttpRequest):
        environ = environ.META.copy()
    if settings.USE_HEKA_FOR_CEF:
        return heka.cef(('%s    %s' % (self.msg_prefix, msg)), severity, environ, **kwargs)
    else:
        return _log_cef(('%s    %s' % (self.msg_prefix, msg)), severity, environ, **kwargs)
