Skip to main content

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

xmllayout2 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 is a fork of Philip Jenveys fork of xmllayout maintained for usage in commercial projects, with supporting a variety of Python versions.

Installation

via pip: pip install xmllayout2

for local development: pip install .

Usage

This package 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)

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

xmllayout2-2.0.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xmllayout2-2.0.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file xmllayout2-2.0.2.tar.gz.

File metadata

  • Download URL: xmllayout2-2.0.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for xmllayout2-2.0.2.tar.gz
Algorithm Hash digest
SHA256 6b3825f251ea94c9a3b247045760ea1e47fe8420c3a5dd5ec5a73be6769bc0b3
MD5 f0522a41981fe61923e16460dd2cb45d
BLAKE2b-256 83f4b59c4d864f4d200f27a7846c69089e47216df049ea29ed0244b89bf2b350

See more details on using hashes here.

Provenance

The following attestation bundles were made for xmllayout2-2.0.2.tar.gz:

Publisher: python-package.yml on jonasdlindner/xmllayout2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xmllayout2-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: xmllayout2-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for xmllayout2-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 346cec2f84b059b06d3835a03c4dc20dbc5c6f1ed082b4de4786f369cd84681b
MD5 b0a658236616f0374afc7d29810e58dd
BLAKE2b-256 6ce6e0abee4a7ab68e6b83a4c38b4b8e81fe507929526f43793d3ec121d76be9

See more details on using hashes here.

Provenance

The following attestation bundles were made for xmllayout2-2.0.2-py3-none-any.whl:

Publisher: python-package.yml on jonasdlindner/xmllayout2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page