writing to elastic isnt working
See original GitHub issueHi, i would like to send my pino logs to elastic, we are using elastic 6 version with latest version of pino and pino-elastic and when i config the below for pino :
let pino = require('pino'),
pinoElastic = require('pino-elasticsearch');
const streamToElastic = pinoElastic({
index: `log-test-%{DATE}`,
type: 'info',
consistency: 'one',
node: 'http://myuser:mypass@localhost:9200',
'trace-level': 'info',
'es-version': 6,
'bulk-size': 1,
ecs: true
});
and then
const logger = pino(pinoOptions, streamToElastic);
logger.info('test');
the app is running ok, but no logs is printed to console and no logs sent to elastic with no errors at all, am i missing something?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Elasticsearch not writing to logs on start - Elastic Discuss
I've been trying to trouble shoot an issue with my single ES node. issue was due to ES logs taking up space on...
Read more >Error writing to Elasticsearch, some elements could not be ...
It means that you overwhelmed the request queue. Your queue was full and the nodes just started to ignore the new requests.
Read more >Caching strategies - Amazon ElastiCache - AWS Documentation
Lazy loadingWrite-throughAdding TTLRelated topics ... A cache hit occurs when data is in the cache and isn't expired: Your application requests data from ......
Read more >How To Install and Configure Elasticsearch on Ubuntu 22.04
Note: Elasticsearch's configuration file is in YAML format, which means that we need to maintain the indentation format. Be sure that you do...
Read more >Elastic-Cloud Not Receiving Data from Serilog Sink - Reddit
Not sure it is in the docs, it's more of a common sense thing - you just need to know that if you're...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found if I write more logs, it sends some of the logs. So I think it’s might be cause of the flushBytes.
If I set flushBytes to 10, all logs appears.
This might be an issue that the last few logs can not be flushed before node.js app terminated.
If you run the main process and pipe this transport, it works automatically, as the stream from the main process and the transport ends.
If you pass this library directly to the pino options, and then kill the process, there is no guarantee that all the logs will be sent, as the process will be destroyed. As I was saying the next version will support a flush interval. We can also think about a force flush method.