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.4.tar.gz (5.5 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.4-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xmllayout2-2.0.4.tar.gz
Algorithm Hash digest
SHA256 6866625fbf8c0c7adc3f3c471bccf3f8dc1db5a2cf496c0855bbfc0a6c300bd8
MD5 00db4f20952da36f06ae87e9e9b3b99a
BLAKE2b-256 bfb29c717804d2f36beaa7347de6158f04092a7334c3ca82d10f7d7adf0fbd38

See more details on using hashes here.

Provenance

The following attestation bundles were made for xmllayout2-2.0.4.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.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for xmllayout2-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e2bc3da37bd07b761a7ae5ffd85b321dcfc261403fe8dd25cbbf455b50c3b52e
MD5 7f5abba9448583a3233c863210617211
BLAKE2b-256 f558d4c657d01ecdaa5ee641914a3ace77ab6eaa2521df94ab598711a43039ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for xmllayout2-2.0.4-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