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.1.tar.gz (8.7 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.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xmllayout2-2.0.1.tar.gz
Algorithm Hash digest
SHA256 132811981422668b29224c10e5dbee2da7499a7446d89d68b569b6e3d8380c45
MD5 2554f464e9390b305d45936f155e6bf1
BLAKE2b-256 d07af142295314df4c2eaaf75b7fd66f4dd5575651f49574821f2d2361639e77

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xmllayout2-2.0.1-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.8

File hashes

Hashes for xmllayout2-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 605eddcc3b74f66a6520f3d9c9f90352ed7dae49d8b891b129780ba7449dadcf
MD5 a21c437541cfa3bf9552db305b4d134d
BLAKE2b-256 b1c3413392a69fac24595cd24daadf6c046a98c8bab2a8bd066750e39e1526a4

See more details on using hashes here.

Provenance

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