Comments (6)
Sorry for the late response.
I can't reproduce the described behavior with your example. It results in a message like (stripped unrelated fields for readability):
{
"message": "some message.",
"type": "python-logstash",
"extra": {
"some": "extra",
"default": "extra",
}
}
Which version of the library are you using?
from python-logstash-async.
I'm using python-logstash-async==2.3.0
from python-logstash-async.
I just tried with your code again, except that I replaced the logger with a standard Python logger instance and added the handler via logger.addHandler(logstash_handler)
and got the expected result.
Might the loguru
package related? I don't what it does.
For reference, here is a full message:
{
"message" => "some message",
"pid" => 551789,
"extra" => {
"func_name" => "<module>",
"interpreter_version" => "3.9.9",
"line" => 30,
"logstash_async_version" => "2.3.0",
"process_name" => "MainProcess",
"some" => "extra",
"path" => "test_issue69.py",
"thread_name" => "MainThread",
"default" => "extra",
"interpreter" => "venv/bin/python",
"logger_name" => "root"
},
"host" => "redacted",
"program" => "test_issue69.py",
"@version" => "1",
"@timestamp" => 2022-01-09T15:09:46.441Z,
"port" => 37278,
"type" => "python-logstash",
"level" => "INFO",
"logsource" => "redacted"
}
from python-logstash-async.
It might be related to loguru but as I mentioned I was able to track the problem, it's related to the _get_extra_fields
method and after overriding it with the fix, the issue was resolved, is it ok if I'll open a pr for that fix?
from python-logstash-async.
Basically a PR is ok but I would like to understand what's the difference and why it works for me with your example and why not for you.
from python-logstash-async.
Feel free to open a PR if you are still interested in and re-open this one. Until then, I like to close this issue.
from python-logstash-async.
Related Issues (20)
- Log level of: "An error occurred while sending events: [Errno 104] Connection reset by peer" HOT 2
- Not working with Django HOT 5
- Crash when logstash server is down (gunicorn with gevent worker) HOT 1
- ImportError: cannot import name 'ParamSpec' from 'typing_extensions' on Python 3.11 HOT 1
- Build pipeline no longer works HOT 1
- Logstash TCP transport errors if not using a client certificate HOT 1
- Sqlite DB not vacuumed HOT 2
- ModuleNotFoundError: No module named 'fcntl' HOT 3
- Broken TCP connection and endless waiting for events from the dark HOT 2
- Makes get_queued_events FIFO or LIFO HOT 1
- Retrieve non flushed event count in sqlite db at start HOT 1
- 2.7.0 doesn't work under Windows HOT 1
- Can cause python code to hang in k8s deployment with python 3.11 HOT 4
- AttributeError: 'MemoryCache' object has no attribute 'get_non_flushed_event_count' HOT 3
- Transport endpoint is not connected HOT 10
- JSON Parse Failure on host Field (could not set field 'ip' on object) HOT 2
- BeatsTransport _batch_size HOT 3
- Improve LogProcessingWorker._fetch_events() performances HOT 2
- Modification to `constants.FORMATTER_RECORD_FIELD_SKIP_LIST` ignored since v3.0.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-logstash-async.