Comments (4)
Just tested and it works for me.
Can you post the relevant part of your config?
Or compare your config to the following snippet which should work:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'logstash': {
'()': 'logstash_async.formatter.DjangoLogstashFormatter',
'message_type': 'customer-message-type',
'fqdn': False, # Fully qualified domain name. Default value: false.
'extra_prefix': 'py',
'extra': [...]
}
}
[...]
from python-logstash-async.
I did a compare with you config snippet and using the GitHub config, but doesn't work either :-(
My config is:
'loggers': {
'django.request': {
'level': 'INFO',
'propagate': True,
'handlers': ['logstash']
},
[...]
'disable_existing_loggers': False,
'version': 1,
'formatters': {
'verbose': {
'datefmt': '%Y-%m-%d %H:%M:%S',
'format': '[%(asctime)s] %(levelname)s %(message)s'
},
'logstash': {
'()': 'logstash_async.formatter.DjangoLogstashFormatter',
'message_type': 'logstash-test'
}
},
[...]
'handlers': {
'logstash': {
'host': 'X.X.X.X',
'certfile': 'logstash.crt',
'ssl_enable': True,
'ssl_verify': False,
'database_path': 'logstash.db',
'keyfile': 'logstash.key',
'class': 'logstash_async.handler.AsynchronousLogstashHandler',
'transport': 'logstash_async.transport.TcpTransport',
'port': 5959
},
[...]
'root': {
'handlers': ['console', 'logstash'],
'level': 'INFO'
}
With this config I can see all the messages in Kibana, only the message_type (type field) was not being set.
from python-logstash-async.
I figure out what I'm doing wrong (or not documented :-D ) ...
In the handler I need to set:
'formatter': 'logstash'
After that, its working :-)
Thank you so much!
from python-logstash-async.
Glad to hear it works now.
JFTR, the formatter option on handlers is not special to python-logstash-async, it's part of the logging framework. Anyway, I'll add the formatter
option to the example in the docs in the next days.
from python-logstash-async.
Related Issues (20)
- Django processes hang HOT 5
- Log record "extra" fields are missing when using LogstashFormatter HOT 6
- 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
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.