mozilla / cef Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED - CEF Logger lib
DEPRECATED - CEF Logger lib
========== CEF logger ========== Most Mozilla Services applications need to generate CEF logs. A CEF Log is a formatted log that can be used by ArcSight, a central application used by the infrasec team to manage application security. The *cef* module provide a `log_cef` function that can be used to emit CEF logs: log_cef(message, severity, environ, config, [username, [signature]], \*\*kw) Creates a CEF record, and emit it in syslog or another file. Args: - message: message to log - severity: integer from 0 to 10 - environ: the WSGI environ object - config: configuration dict - signature: CEF signature code, defaults to 'AuthFail' - username: user name, defaults to 'none' - extra keywords: extra keys used in the CEF extension Example:: >>> from cef import log_cef >>> log_cef('SecurityAlert!', 5, environ, config, ... msg='Someone has stolen my chocolate') With *environ* and *config* provided by the web environment. You can use the cef module with pythons logging module. Example of logging configuration:: 'syslog': { '()': cef.SysLogFormatter, 'datefmt': '%H:%M:%s', }, Send message to the log:: log_file.warning('Something', {environ: environ, username: request.user, data: data}) The SysLogFormatter will use the date format set in the log configuration (datefmt). It will convert the logging error level into a sys log error level. CEF specific fields (version, vendor, device_version, product) can be also be provided, defaults will be used if not passed.
python3 does not supported unicode type string
FYI: The following changes were made to this repository's wiki:
defacing spam has been removed
the wiki has been disabled, as it was not used
These were made as the result of a recent automated defacement of publically writeable wikis.
As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:
If you have any questions about this file, or Code of Conduct policies and procedures, please reach out to [email protected].
(Message COC001)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.