Coder Social home page Coder Social logo

Comments (2)

edgarrmondragon avatar edgarrmondragon commented on May 29, 2024

Hey @BillyUdders, thanks for logging!

I think this is unfortunately expected from Python's builtin logging.handlers.HTTPHandler. From the docs1:

Since preparing a record for sending it to a web server is not the same as a generic formatting operation, using setFormatter() to specify a Formatter for a HTTPHandler has no effect. Instead of calling format(), this handler calls mapLogRecord() and then urllib.parse.urlencode() to encode the dictionary in a form suitable for sending to a web server.

Perhaps you could try using a package like python-logstash-async2. You would need to install it in the same venv as Meltano. If you're using pipx3, it's as simple as

pipx inject meltano python-logstash-async

Footnotes

  1. Official docs for logging.handlers.HTTPHandler

  2. GitHub repo for python-logstash-async

  3. GitHub repo for pypa/pipx

from meltano.

edgarrmondragon avatar edgarrmondragon commented on May 29, 2024

Can confirm the above:

import logging
from logging.handlers import HTTPHandler
from urllib.parse import urlencode

record = logging.LogRecord("my_logger", logging.INFO, "/path/to/file.py", 10, "EVENT!", (), None)
handler = HTTPHandler("localhost", 5000)
print(urlencode(handler.mapLogRecord(record)))
# name=my_logger&msg=EVENT%21&args=%28%29&levelname=INFO&levelno=20&pathname=%2Fpath%2Fto%2Ffile.py&filename=file.py&module=file&exc_info=None&exc_text=None&stack_info=None&lineno=10&funcName=None&created=1706751680.052684&msecs=52.0&relativeCreated=8.797883987426758&thread=8648734912&threadName=MainThread&processName=MainProcess&process=39301&taskName=None

Closing, since this is not a bug and is not Meltano's doing.

from meltano.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.