Formats Python log messages as log4j XMLLayout XML
Project description
XMLLayout2 provides a Python logging Formatter that formats log messages as XML, according to `log4j's XMLLayout specification
XMLLayout formatted log messages can be viewed and filtered within the Chainsaw application (see the example section below), part of the Java based log4j project.
This package also includes a RawSocketHandler -- like logging.handler.SocketHandler, but sends the raw log message over the socket instead of a pickled version. RawSocketHandler can be configured to send log messages to Chainsaw directly over a socket.
For example: to forward log messages to Chainsaw, if it were listening on localhost port 4448::
import logging
import xmllayout2
handler = xmllayout2.RawSocketHandler('localhost', 4448)
handler.setFormatter(xmllayout2.XMLLayout())
logging.root.addHandler(handler)
This is a fork of Philip Jenveys original package xmllayout. Maintained for usage in commercial projects, with supporting a variety of Python versions.
Installation via pip: pip install xmllayout2
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xmllayout2-2.0.0.tar.gz.
File metadata
- Download URL: xmllayout2-2.0.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35dcbb7e1195dd311dcb826342257f813d2c023690cb671698e0c2ef6847e75a
|
|
| MD5 |
9ac9b1874dcfc688b28bfd0588a05920
|
|
| BLAKE2b-256 |
8c144130ac0424101f7c1aa1ba80c6ca5b449b05a23b37d348bc7656f96349f7
|
File details
Details for the file xmllayout2-2.0.0-py3-none-any.whl.
File metadata
- Download URL: xmllayout2-2.0.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
605a50fb3b9241794c9f66fb98522b387dd5b75c97d9d876a8cdb83849be2422
|
|
| MD5 |
29966c127eadaaf5152696b1a0e9752b
|
|
| BLAKE2b-256 |
fa61c55a2bc4ae14da3eb6b81a03a2ba41a895f4a1a3df7388bf7d4d350c9fbb
|